What do you want to achieve?
So Im recently using abbreviation module but I need also decimals abbreviation for numbers like 9.199999901.
What is the issue? Include screenshots / videos if possible!
When I tried to implement it to my code, numbers on gui was froze
What solutions have you tried so far?
I took part of this code from devforum and Im still beginner so I tried to figured it out by myself but I wasnt able to do that so thats why Im here.
My code without decimal abbreviation:
local M = require(game.ReplicatedStorage:WaitForChild("ModuleScript"))
local plr = game.Players.LocalPlayer
local stats = plr.Stats.Cash.Value
while wait() do
script.Parent.Text = " "..M.ZeroTwoIsCute(stats)
end
Decimal abbreviation script:
local str = string.format("%.2f", stats)
stats = tonumber(str)
Thank you for helping me with this basic problem as I said Im still beginner so thats it.
I think its because you overloaded with decimals, maybe its overloading number registers and causing crash. Can you record how it works and i have to ask, Decimal abbreviation script is
game.ReplicatedStorage:WaitForChild(“ModuleScript”)?
Alright so this is the script so I need to define stats?
local M = {}
local ZeroTwoCute = {"K","M","B","T"}
M.ZeroTwoIsCute = function(Input)
for ZeroTwo = #ZeroTwoCute, 1, -1 do
local v = math.pow(10, ZeroTwo * 3)
if Input >= v then
return tostring(Input / v):sub(1,5)..ZeroTwoCute[ZeroTwo]
end
end
return tostring(Input)
end
return M