Answered by
5 years ago Edited 5 years ago
You will have to do something like this:
02 | local simplifyCoins = 0 |
05 | simplifyCoins = coins / 1000000 |
07 | simplifyCoins = math.floor(simplifyCoins * 100 )/ 100 |
09 | simplifyCoins = tostring (simplifyCoins) |
12 | print (simplifyCoins.. "M" ) |
14 | elseif coins > 999 then |
15 | simplifyCoins = coins / 1000 |
17 | simplifyCoins = math.floor(simplifyCoins * 100 )/ 100 |
19 | simplifyCoins = tostring (simplifyCoins) |
21 | print (simplifyCoins.. "K" ) |
Prints
basically you just check to see how high coins is, then divide it by whatever place it falls on, then concatenate an "M" or "K".
[EDIT]
I made it round down 2 decimal places to make it easier to read for the larger numbers. Also,I would put the repeated code inside of a function that is called within the if statements to avoid repeating the same code (that would be a lot of wasted lines if you went up to quintillions)