function round100(n)
return math.floor(n*100)/100
end
function round3(n)
return math.floor(n/3)*3
end
local signs = {
"K",
"M",
"B",
"T",
"Qd",
"Qn",
"Sx",
"Sp",
"Oc",
"No",
"De",
"UDe",
"DDe",
"TDe",
"QdDe",
"QnDe",
"SxDe",
"SpDe",
"OcDe",
"NoDe",
"Vg",
}
function shorten(n)
if n >= 1000 then
local num = round100(n/10^round100(round3(math.floor(math.log10(n)))))
local sign = signs[round3(math.floor(math.log10(n)))/3]
return num..sign
else
return n
end
end
for i = 1, 100 do
print(
"Cost: $" .. shorten(round100(12.5^(i-1))) .. " " .. "Luck: x" .. shorten(round100(1.5^(i-1))),
i
)
end
To embed this project on your website, copy the following code and paste it into your website's HTML: