ID:162304
 
I know its possible from experience seeing it, and I was wondering how to do so. Could someone show how to convert high numbers into their full lengths?

For example:

1e+006 = 1000000
1.5427e+006 = 1542700
etc.
etc.
Godzooks wrote:
I know its possible from experience seeing it, and I was wondering how to do so. Could someone show how to convert high numbers into their full lengths?

For example:

1e+006 = 1000000
1.5427e+006 = 1542700
etc.
etc.

You can use num2text() to exercise greater control over how numbers print. However you should be aware that BYOND's upper limit for accurate integers is about 16.8 million, because it uses floating point. If you have stats in the millions you should consider dropping them to more down-to-earth values, which is not only easier on BYOND but better game design.

Lummox JR
In response to Lummox JR
Well, I only considered using this feature for money. Instead of having 1e+006-1.2e+010, you would have a more realistic value like 1,264,728 - 12,621,124,493
In response to Godzooks
I have a library for this.

y2k_UncondenseNum
In response to Y2kEric
Except, as was already said, num2text() can be used for this.
In response to Godzooks
Godzooks wrote:
Well, I only considered using this feature for money. Instead of having 1e+006-1.2e+010, you would have a more realistic value like 1,264,728 - 12,621,124,493

1e+006 = 1,000,000
Same number of digits as 1,264,728
This is below 16.8 million so it’s fine.

1.2e+010 = 12,000,000,000
Same number of digits as 12,621,124,493
This is above 16.8 million so it‘s not fine.

The first number is fine.

If you want your numbers to be accurate, keep them below 16,777,216. After that, you start to lose significant digits.

For example, say you have 1,000,000,000 and you want to add 1 to it. 1,000,000,000+1 should equal 1,000,000,001. However, it won’t because the number can't store that many sig figs.