Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my script using the wrong suffix for a number?

Asked by 3 years ago
Edited 3 years ago

https://prnt.sc/1qdjy1y

I made this script to add suffixes to values so 1 000 000 = 1M, 5 250 000 000 = 5.25B, etc and it works fine but I tested it for 1 decillion which is 10^33 and it displayed 1000.00 nonillion (nonillion is 1/1000 of a decillion). It usually works fine but sometimes the display would not use the highest suffix. I thought this is because the number is actually slightly less than 1 Decillion, but I put in exactly 1 decillion multiple times and got the same error

Edit: Forgot to show suffix table https://prnt.sc/1qdk0y5

0
~~~~~~~~~~~~~~~~~ 9898532165 ÷ 1000 = 9898532.165-- numbersuffix+1 9898532.165 ÷ 1000 = 9898.532165-- numbersuffix+1 9898.532165 ÷ 1000=9.898532165-- numbersuffix+1 9.898532165<1000 --conclusion:numbersuffix=3 --But 9898532165 is a bilion number so you must table.remove(suffixtable,1) because when you add " " in your table, numbersuffix=3 is "M" ~~~~~~~~~~~~~~~~~ lehoaiquoc248 23 — 3y
0
When I get the number suffix i get suffixtable[numbersuffix+1] matthewliu 0 — 3y

Answer this question