So in Zednov's tycoon kit, theres a script called settings. This abbreviates 1,000 cash into 1K and 1,000,000 into 1M, and 1,000,000,000 into 1B. But there is nothing above that. I'd like for someone to help me with making 1T, 1Qd, 1Qn, to like De or something. I would love to know how to do this since the script looks confusing as hell and I have no idea how to script:
Script:
function module:ConvertComma(num) local x = tostring(num) if #x>=10 then local important = (#x-9) return x:sub(0,(important))..","..x:sub(important+1,important+3)..","..x:sub(important+4,important+6)..","..x:sub(important+7) elseif #x>= 7 then local important = (#x-6) return x:sub(0,(important))..","..x:sub(important+1,important+3)..","..x:sub(important+4) elseif #x>=4 then return x:sub(0,(#x-3))..","..x:sub((#x-3)+1) else return num end end function module:ConvertShort(Filter_Num) local x = tostring(Filter_Num) if #x>=10 then local i 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 return module
--End of script
As you see, theres only K+, M+, and B+... I need higher ones...
To abbreviate numbers above a billion, you have to create a new if statement, for this example I'm going to abbreviate the trillion and quadrillion. But, you can abbreviate to whatever large number you want. The first step is to get the scientific notation of the number you want to abbreviate which you can get here. The second step is to go to the Settings module, scroll down to the ConvertShort function and after the code snippet:
local x = tostring(Filter_Num)
Write:
if #x>=(the exponent number plus one (1)) local important = (#x-(the exponent number)) return x:sub(0,(important)).."."..(x:sub(#x-(exponent number minus 2),(#x-(exponent number minus 2).."(whatever abbreviation you want)" end
Now here is an example with trillion and quadrillion:
if #x>=16 then local important = (#x-15) return x:sub(0,(important)).."."..(x:sub(#x-14,(#x-14))).."Qd+" end if #x>=13 then local important = (#x-12) return x:sub(0,(important)).."."..(x:sub(#x-11,(#x-11))).."T+" end