From what i read roblox dont allow to show number bigger that 1e310 and it show it as inf.
But i have been seen a games that have bigger numbers that 1e310 i try doing some calculations and etc but still show inf.
Is there a possible way to make it show the real number unsted of inf ?
The currect script that i use for the prefixes.
local Short = {}
Short.Comma = function(Value)
local Number
local Formatted = Value
while true do
Formatted, Number = string.gsub(Formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if (Number == 0) then
break
end
end
return Formatted
end
function addComas(str)
return #str % 3 == 0 and str:reverse():gsub("(%d%d%d)", "%1,"):reverse():sub(2) or str:reverse():gsub("(%d%d%d)", "%1,"):reverse()
end
local function roundWhole(n)
return math.floor(n + 0.5)
end
local function roundDecimal(t)
return math.floor(t * 10) * 0.1
end
Short.en = function(Input)
local prefixes = {
"K", "M", "B", "T",
"aa", "ab", "ac", "ad", "ae", "af", "ag", "ah", "ai", "aj", "ak", "al", "am", "an", "ao", "ap", "aq", "ar", "as", "at", "au", "av", "aw", "ax", "ay", "az",
"ba", "bb", "bc", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bk", "bl", "bm", "bn", "bo", "bp", "bq", "br", "bs", "bt", "bu", "bv", "bw", "bx", "by", "bz",
"ca", "cb", "cc", "cd", "ce", "cf", "cg", "ch", "ci", "cj", "ck", "cl", "cm", "cn", "co", "cp", "cq", "cr", "cs", "ct", "cu", "cv", "cw", "cx", "cy", "cz",
"da", "db", "dc", "dd", "de", "df", "dg", "dh", "di", "dj", "dk", "dl", "dm", "dn", "do", "dp", "dq", "dr", "ds", "dt", "du", "dv", "dw", "dx", "dy", "dz"}
if Input < 1000 then
return string.format("%d", Input)
end
local index = 0
while Input >= 1000 and index < #prefixes do
Input = Input / 1000
index = index + 1
end
local formattedValue
if Input == math.floor(Input) then
formattedValue = string.format("%.0f", Input)
elseif Input >= 100 then
formattedValue = string.format("%.0f", Input)
elseif Input >= 10 then
formattedValue = string.format("%.1f", Input)
else
formattedValue = string.format("%.2f", Input)
end
formattedValue = formattedValue:gsub("%.0$", "")
formattedValue = formattedValue:gsub("%.", ",")
return formattedValue .. prefixes[index]
end
return Short
screen to show the textlabel