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
»
AddOns, Compilations, Macros
»
AddOn Help/Support
»
How to round a number in itemlevel?
Go to Page...
Reply
View First Unread
Thread Tools
Display Modes
04-27-13, 12:22 AM
#
1
siweia
A Flamescale Wyrmkin
Join Date: Jul 2011
Posts: 126
How to round a number in itemlevel?
===
SOLVED
===
Hi all,
In this addon
Equipped Item Level
, my average item level is 500.8, but the problem is that I don't really want any decimal appears.
I changed the "%.1f" to "%d", and the ilvl became 500 which was 501 on my character frame.
is it possible to round up or round down a number in the addon, like what we did in math.
Last edited by siweia : 04-27-13 at
07:10 AM
.
siweia
View Public Profile
Send a private message to siweia
Find More Posts by siweia
04-27-13, 12:45 AM
#
2
Dridzt
A Pyroguard Emberseer
Join Date: Nov 2005
Posts: 1,360
floor(ilvl+0.5)
Dridzt
View Public Profile
Send a private message to Dridzt
Find More Posts by Dridzt
04-27-13, 07:09 AM
#
3
siweia
A Flamescale Wyrmkin
Join Date: Jul 2011
Posts: 126
Originally Posted by
Dridzt
floor(ilvl+0.5)
Thanks a lot!
siweia
View Public Profile
Send a private message to siweia
Find More Posts by siweia
04-27-13, 07:33 AM
#
4
Dridzt
A Pyroguard Emberseer
Join Date: Nov 2005
Posts: 1,360
Originally Posted by
siweia
Thanks a lot!
Just a note that you can also 'abuse' the format specifier to do it.
string.format("%.
0
f",500.8)
>
501
Dridzt
View Public Profile
Send a private message to Dridzt
Find More Posts by Dridzt
Reply
WoWInterface
»
AddOns, Compilations, Macros
»
AddOn Help/Support
» How to round a number in itemlevel?
«
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