Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to format numbers as currrency?

Asked by
NewGPU 36
6 years ago
Edited 4 years ago

I did this a long while ago but I do not remember how to anymore.

If my value was 1000 I'd want it display as 1,000 instead, this is to be used in a GUI.

Thanks, NewGPU

0
bump NewGPU 36 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

You cant without making your own GUI. Rename "LeaderStats" in player to something else so it isnt automatically made.

then you have to code it so that it works the way you want.

0
no not like that. NewGPU 36 — 6y
0
Well you i dont think you can make leaderstats without using the default one unless you make it yourself. which isnt that hard AnAnonymousDeveloper 77 — 6y
0
I just want to format my numbers to "1,234" instead of "1234" and use it in a gui with a textlabel. Example: script.Parent.Text = player:WaitForChild("MyNumbers").Value player:WaitForChild("MyNumbers").Changed:Connect(function() script.Parent.Text = player:WaitForChild("MyNumbers").Value end) instead of having it displayed as 1234 i want to display it as 1,234 if that was my value. NewGPU 36 — 6y
Ad
Log in to vote
0
Answered by
Kblow1 53
6 years ago

Well, If your looking to make a leaderstats like that. Use this code.

game.Players.PlayerAdded:Connect(function(plr) -- When Player Added.
    local stats = Instance.new("IntValue", plr) -- Insert an IntValue into all players that join.
    stats.Name = "leaderstats" -- Names it 'leaderstats'
    local Money = Instance.new("IntValue", stats) -- puts IntValue into all players 'leaderstats'
    Money.Name = "Money" -- Puts name as money. Change name to your currency.
    Money.Value = 5000 -- How much money all players start with.

Answer this question