I am trying to make a GUI that constantly updates to show how much cash you have in my game, and everything is working except for I would like it to include commas, so for example if you had 5,000 cash, instead of it saying 5000, I would like a comma between the 5 and the 0.
Is this achievable with a simple method?
Take a look at this link, and it will show you how to format numbers correctly. I also remember seeing a module for this in roblox lua a while back in dev forum, but I forgot where it was.
1 Like
-
Get this and place in ReplicatedStorage:
Short - Roblox
-
Make A LocalScript in the gui text:
local Module = require(game.ReplicatedStorage.Short)
local Player = game.Players.LocalPlayer
local Cash = Player:WaitForChild("leaderstats"):WaitForChild("Cash") -- Choose
while wait() do
script.Parent.Text = "Cash: $"..Module.en(Cash.Value)
end
4 Likes