HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

R2SW

02-21-2009, 02:08 PM#1
Troll-Brain
Collapse JASS:
native R2SW takes real r, integer width, integer precision returns string

I understand how to use the argument precision, but it seems the width argument has no effect, or i miss something ?
02-21-2009, 04:17 PM#2
Toadcop
isn't width = 0.xxxx ? number of signs after . ?
well i allways use the same values for both xD and it works well...
02-21-2009, 05:06 PM#3
Troll-Brain
Quote:
Originally Posted by Toadcop
isn't width = 0.xxxx ? number of signs after . ?
No only "precision" change the number.

Quote:
well i allways use the same values for both xD and it works well...
I guess i will use that for "width" :

Expand JASS:
02-22-2009, 02:30 AM#4
fX_
What does R2SW() do?
02-22-2009, 08:33 AM#5
Troll-Brain
Like R2S, R2SW takes a real and return a string, but you can also choice the numbers of signs under the digit.
The rounding of the real number is done like R2S : http://en.wikipedia.org/wiki/Rounding#Common_method

But with R2S you will get a string with 3 numbers under the digit, with R2SW you can choice 0 or more.
But if you choice 0 the real number will be rounded and the string will have one number under the digit, if you don't want any number under the digit you must use SubString(BJ) to remove it.