i was following a youtube toutorial on how to make numbers abreviate but when i get to the Qintillions the it breaks here is the script
local AbbreviateNumber = {}
local Abbreviations = {
K = 4,
M = 7,
B = 10,
T = 13,
Qa = 16,
Qi = 19,
Si = 22,
Sp = 25,
Oc = 28,
N = 31,
Dc = 34,
Un = 37,
Duo = 40,
}
function AbbreviateNumber:Abbreviate(number)
local text = tostring(math.floor(number))
local chosenAbbreviation
for Abbreviation, digits in pairs(Abbreviations) do
if #text >= digits and #text < (digits + 3) then
chosenAbbreviation = Abbreviation
break
end
end
if chosenAbbreviation then
local digits = Abbreviations[chosenAbbreviation]
local rounded = math.floor(number / 10 ^ (digits - 2)) * 10 ^ (digits - 2)
text = ""..string.format("%.1f", rounded / 10 ^ (digits - 1))..chosenAbbreviation
else
text = ""..number
end
return text
end
return AbbreviateNumber
