-
What do you want to achieve? I want this abbreviation script to work with my string value leaderstats
-
What is the issue? I keep on getting an error when it compares it to a number
I’ve tried to ask some friends about it, and checked dev forum, but i didn’t find any information
-- This is an example Lua code block
local function shorten(Input)
local Negative = Input < 0
Input = math.abs(Input)
local Paired = false
for i,v in pairs(MoneyLib.Suffixes) do
if not (Input >= 10^(3*i)) then
Input = Input / 10^(3*(i-1))
local isComplex = (string.find(tostring(Input),".") and string.sub(tostring(Input),4,4) ~= ".")
Input = string.sub(tostring(Input),1,(isComplex and 4) or 3) .. (MoneyLib.Suffixes[i-1] or "")
Paired = true
break;
end
end
Thanks for reading🙂