ID:172242
 
See in my game I have this

stat("Exp:","[num2text(exp,10000000)]")

To stop the number from going to scientific notation, right? Well, if I put it higher, I get an out of memory msg, and my exp in my game needs to get over that ammount later on, so how can I do it so I dont get the Out of Memory msg, but still get a non scientific notation number?
Try using a number of digits that is no obscene.
That number you are using is not the highest value that will not use scientific notation, it is the number of digits in the highest value that will not use scientific notation. So, you are telling num2text not to use scientific notation until the number is higher than 10000000000000000... (insert almost 10000000 0's here) ...00000000000000000. Thats a bit too large. Try using something like 12. That allows you to use values up to 100000000000.

I'm not actually sure how big a number Byond is able to deal with anyway.
To stop the number from going to scientific notation, right? Well, if I put it higher, I get an out of memory msg, and my exp in my game needs to get over that ammount later on, so how can I do it so I dont get the Out of Memory msg, but still get a non scientific notation number?

You really need to scale down your experience to smaller values. BYONDs floating point math isn't very precise so when you get into numbers this large you start losing a lot of data in your least significant digits.
In response to Flick
8 and I get the msg, if u noticed] I had 7 0s with a 1 at the top. But lets just go to this, how about just STOPPING Scientific Notation from being stated?
In response to Metroid
You're still missing Flick's point. The second argument of num2text() is the number of digits. If you require a number with more than 10 million digits, you also need to develop your own number system because floating point numbers are not going to do it.

If you want to display 6340478210, you need num2text(varname,10) because it is a 10 digit number, NOT num2text(varname,1000000000). num2text() works properly with a second argument up to 20. That's a value up to 99999990000000000000. With more than 20 digits, it will use scientific notation no matter what value you supply for the second argument.

Just to reinforce what Theodis says, my test case of num2text(12345678901234567890, 20) returned "12345679395506094000", which is 494271526110 more than the actual value. This is not a flaw in BYOND, but a limitation of floating point numbers that is universal to all computer systems because of the way the data is handled. With floating point you're limited to about 7 significant digits, no matter how many digits are actually in the number.

The only way around the rounding error is to create a custom number system of your own. After you develop a format, you have to design procs for all the mathmatical functions you wish to perform with them. For a simple experience system, you would want a proc to add values together and a proc to see if one value is greater than another value. For a more robust number system, you would want to provide procs for all the numeric operators (like + - * / % < > = and more) as well as numeric procs like round().
In response to Shadowdarke
Shadowdarke wrote:
You're still missing Flick's point. The second argument of num2text() is the number of digits. If you require a number with more than 10 million digits, you also need to develop your own number system because floating point numbers are not going to do it.

I think your going to need another universe, because I'm not so sure there are even 1(insert 10 million zeros here) atoms in this one. Thats a BIG number :P

*EDIT* wow, that is a big number. Turns out, their are roughly 1x10^79 atoms in the observable universe, not even remotely close to that above number. :)
In response to Flick
Also, don't forget the fact that the computer will store the number in binary and require even more digits where it is concerned for data storage. Meaning, more than 1*10^10,000,000 atoms.
In response to Flick
I don't know. Off the top of my head, I can think of a way to store a 10 million digit number in a text file around 5Mb in size. 2 digits per character would be a simple compression scheme. You could squeeze it much further if you cared to get into some messy math.

Format aside, good luck displaying it in a statpanel! ;p
In response to Shadowdarke
Shadowdarke wrote:
Format aside, good luck displaying it in a statpanel! ;p

Or finding something to count with it.