AddOns
AddOn Manager
Latest 200
Browse
Upload AddOn
Search AddOns
Projects
Author Portals
Git Repositories
SVN Repositories
Options
Email Feeds
Preference
Download History
News
Forums
New posts
Today's Posts
Search Forum
Categories
General
AddOns, Comps, Macros
Featured Projects
Developer
Site Forums
Mark Forums Read
Subscribed Threads
Open Buddy List
Members List
Help
Login
Sign up
WoWInterface
»
Developer Discussions
»
General Authoring Discussion
»
Lua/XML Tips for a newb, please.
Go to Page...
Reply
View First Unread
Thread Tools
Display Modes
04-13-08, 05:12 PM
#
1
VaasDeferens
A Murloc Raider
Join Date: Feb 2007
Posts: 4
Lua/XML Tips for a newb, please.
Code:
KIBLANShowTime:SetText(string.format(total));
I've got the above code set to display a time (in seconds) in a KIBLANShowTime frame. It properly displays, kinda ...
It's showing milli, micro, nano seconds etc. (ie: 31.441758291).
I see that "math.floor()" should be used to format(round) the string, but I am uncertain of how the syntax would fit into the SetText element.
Thanks in advance...
VaasDeferens
View Public Profile
Send a private message to VaasDeferens
Find More Posts by VaasDeferens
04-13-08, 05:19 PM
#
2
Layrajha
A Frostmaul Preserver
Join Date: Mar 2006
Posts: 275
Well, you just have to use the value returned by "math.floor" called on your previous value. Syntactically, if you had a your number stored in "total", just replace "total" by "math.floor(total)" wherever you want to use the rounded value.
Layrajha
View Public Profile
Send a private message to Layrajha
Find More Posts by Layrajha
04-13-08, 05:30 PM
#
3
VaasDeferens
A Murloc Raider
Join Date: Feb 2007
Posts: 4
Damn you rock and made me feel silly. Thanks, boss.
VaasDeferens
View Public Profile
Send a private message to VaasDeferens
Find More Posts by VaasDeferens
Reply
WoWInterface
»
Developer Discussions
»
General Authoring Discussion
» Lua/XML Tips for a newb, please.
«
Previous Thread
|
Next Thread
»
Thread Tools
Show Printable Version
Email this Page
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
vB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off