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...
  Reply With Quote
04-13-08, 05:19 PM   #2
Layrajha
A Frostmaul Preserver
 
Layrajha's Avatar
AddOn Author - Click to view addons
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.
  Reply With Quote
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.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Lua/XML Tips for a newb, please.


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