So I have a currency convert script where if it goes above a certain number of 0's then it converts to 1M+ for example. It converts up to 99T+ but then when the NumberValue reaches 100T it displays 1e.+K+ and then the 1 goes to 2, etc. when higher. My Code:
function module:ConvertShort(Filter_Num)
local x = tostring(Filter_Num)
if #x>=19 then
local important = (#x-18)
return x:sub(0,(important))..".."..(x:sub(#x-15,(#x-15))).."Qn+"
elseif #x>=16 then
local important = (#x-15)
return x:sub(0,(important))..".."..(x:sub(#x-13,(#x-13))).."Q+"
elseif #x>=13 then
local important = (#x-12)
return x:sub(0,(important)).."."..(x:sub(#x-10,(#x-10))).."T+"
elseif #x>=10 then
local important = (#x-9)
return x:sub(0,(important)).."."..(x:sub(#x-7,(#x-7))).."B+"
elseif #x>= 7 then
local important = (#x-6)
return x:sub(0,(important)).."."..(x:sub(#x-5,(#x-5))).."M+"
elseif #x>=4 then
return x:sub(0,(#x-3)).."."..(x:sub(#x-2,(#x-2))).."K+"
else
return Filter_Num
end
end
I'm not really sure what is wrong here. If someone could please help me that would be great! Also, I do have my leaderboard script that has the function activate when displaying the value.

1 comment
https://forum.scriptinghelpers.org/topic/990/how-to-format-numbers-like-miners-haven-does