My items are displayed on screen with maptext of the stack amount, Having a problem with large numbers over 999. How would i go about breaking this down to something like this example: 1.2k , 1.5M, 10M , 1B?
This also works for Maptext damage numbers, btw is there a way to make maptext look pretty? Instead of the default as if you would manual craft every letter?
|
maptext supports full HTML (And I believe partial CSS? Don't quote me on that) formatting.
maptext = "<font color=red>This is red!" |
As Ter13 alluded to, BYOND can only natively handle positive integers accurately up to 16,777,215. If you think that you're going to have to actually need to store numbers larger than that accurately to single digit precision, then my pif_LongInt library can be useful to you. Right now, unsigned integers are accurate up to 4,294,967,295 (i.e., 256 times more accurate than BYOND can natively handle), and future updates will increase that accuracy to 281,474,976,710,655 and then 18,446,744,073,709,551,615 (probably far larger than you'd ever need to worry about).
|
Actually it can handle 16,777,216 as well, since that's a power of 2; it's past that where the breakdown occurs.
|
BYOND doesn't deal with really big numbers very well though. You are going to get inaccuracy when adding small numbers to very large numbers because of floating point limitations.