ID:172395
 
Is there a way to get rid of high numbers in a game such as 5.15678e+06 because i dont know how and i really want just regular numbers like 500000 instead of things like 5.15678e+06 I.E Exp Needed and so on. so is there a way to fix this?
Use a combination of round and num2text();
stat("EXP needed","[num2text(round(src.EXPneed,1),7)]")
if you're worried about the cosmetic value in stat panels or whatever; num2text() has a second argument that determines the amount of "significant digits" before using scientific notation. If you want to round these values for use in other procs or whatnot, round the required variables before ending the proc.
In response to Enigmaster2002 (#1)
Enigmaster2002 wrote:
Use a combination of round and num2text();
stat("EXP needed","[num2text(round(src.EXPneed,1),7)]")
if you're worried about the cosmetic value in stat panels or whatever; num2text() has a second argument that determines the amount of "significant digits" before using scientific notation. If you want to round these values for use in other procs or whatnot, round the required variables before ending the proc.

        stat("Experience:  ","[num2text(round(src.exp,1),7)]")
stat("Experience needed","[num2text(round(src.expnext,1),7)]")


IT still doesnt do what i want it to
In response to XzDoG (#2)
And 'what' do you want it to do
In response to Vash_616 (#3)
Once i get over a million needed experience it goes to like 1e+02 etc and i dont want that
In response to XzDoG (#4)
Then increase the second argument in num2text() until it does what you want it to.

stat("EXP needed","[num2text(round(src.EXPneed,1),7)]")
In response to Enigmaster2002 (#5)
Enigmaster2002 wrote:
Then increase the second argument in num2text() until it does what you want it to.

stat("EXP needed","[num2text(round(src.EXPneed,1),7)]")

how exactly does the increasement work?
In response to XzDoG (#6)
In the instance of the example I provided, 7 will display seven digits before it starts using scientific notation. So a value of 10 would display ten digits before scientific notation, a value of 2 would display two digits... etc etc.
In response to Enigmaster2002 (#7)
thanks ive never used that before so now i know, thanks for the help
In response to XzDoG (#8)
XzDoG wrote:
thanks ive never used that before so now i know, thanks for the help

Or, if you're going for completeness:

proc
num2comma(Number)
Number=round(Number,1)
if(Number<=0||!Number)
Number="0"
else
if(Number>=0&&Number<1000)
Number="[copytext("[num2text(Number,10)]",1,4)]"
else
if(Number>=1000&&Number<10000)
Number="[copytext("[num2text(Number,10)]",1,2)],[copytext("[num2text(Number,10)]",2,5)]"
else
if(Number>=10000&&Number<100000)
Number="[copytext("[num2text(Number,10)]",1,3)],[copytext("[num2text(Number,10)]",3,6)]"
else
if(Number>=100000&&Number<1000000)
Number="[copytext("[num2text(Number,10)]",1,4)],[copytext("[num2text(Number,10)]",4,7)]"
else
if(Number>=1000000&&Number<10000000)
Number="[copytext("[num2text(Number,10)]",1,2)],[copytext("[num2text(Number,10)]",2,5)],[copytext("[num2text(Number,10)]",5,8)]"
else
if(Number>=10000000&&Number<100000000)
Number="[copytext("[num2text(Number,10)]",1,3)],[copytext("[num2text(Number,10)]",3,6)],[copytext("[num2text(Number,10)]",6,9)]"
else
if(Number>=100000000&&Number<999999999)
Number="[copytext("[num2text(Number,10)]",1,4)],[copytext("[num2text(Number,10)]",4,7)],[copytext("[num2text(Number,10)]",7,10)]"
else
if(Number>=1000000000)
Number="[copytext("[num2text(Number,10)]",1,2)],[copytext("[num2text(Number,10)]",2,5)],[copytext("[num2text(Number,10)]",5,8)],[copytext("[num2text(Number,10)]",8,11)]"
return Number
In response to Goku72 (#9)
after it goes past 1 bil, just replace it with "YOUR TOO HIGH LVL, GET A LIFE!"
lol