I am trying to make a script to go up to like Quadrillion, and Quintilian but it messes up at 100 Trillion, can anyone help me with this?
Code:
local money = script.Parent.Parent["Money"]
while wait() do
local val = math.abs(money.Value)
local str = tostring(val)
-- Trillions
if val >=1e+14 then
script.Parent.Text = string.sub(str, 1,3).."."..string.sub(str, 4,4).."T+"
elseif val >=1e+13 then
script.Parent.Text = string.sub(str, 1,2).."."..string.sub(str, 3,3).."T+"
elseif val >=1e+12 then
script.Parent.Text = string.sub(str, 1,1).."."..string.sub(str, 2,2).."T+"
-- Billions
elseif val >=1e+11 then
script.Parent.Text = string.sub(str, 1,3).."."..string.sub(str, 3,3).."B+"
elseif val >=1e+10 then
script.Parent.Text = string.sub(str, 1,2).."."..string.sub(str, 3,3).."B+"
elseif val >=1e+9 then
script.Parent.Text = string.sub(str, 1,1).."."..string.sub(str, 2,2).."B+"
-- Millions
elseif val >=1e+8 then
script.Parent.Text = string.sub(str, 1,3).."."..string.sub(str, 3,3).."M+"
elseif val >=1e+7 then
script.Parent.Text = string.sub(str, 1,2).."."..string.sub(str, 3,3).."M+"
elseif val >=1e+6 then
script.Parent.Text = string.sub(str, 1,1).."."..string.sub(str, 2,2).."M+"
-- Thousands
elseif val >=1e+5 then
script.Parent.Text = string.sub(str, 1,3).."."..string.sub(str, 3,3).."M+"
elseif val >=1e+4 then
script.Parent.Text = string.sub(str, 1,2).."."..string.sub(str, 3,3).."M+"
elseif val >=1e+3 then
script.Parent.Text = string.sub(str, 1,1).."."..string.sub(str, 2,2).."M+"
-- Hundreds
elseif val >=0 then
script.Parent.Text = str
end
end

4 comments
It's actually half of that, since you have to account for negatives too. The range is -2147483648 to 2147483647.
Oh yeah, you're right. Thanks for correcting me... Either way, still stuck at Trillions.
Also the range of an integer doesn't have much to do with whether a program is 32 bit or 64 bit. That has more to do with how many locations in memory a program can address. It's just that the de-facto standard seems to be that a stadard integer is 32 bits. (Can anybody point me to an actual IEEE or similar standard on this?)
But how does it work in Miner's Haven? There are numbers much larger than trillions!