of     1   

Low_Flo
#184083911Sunday, February 21, 2016 5:47 PM GMT

I am displaying a players leaderstats on a GUI. I want it so when the players stats is bigger than 999 that it inserts commas as example "1,000,000". This would help me a lot. I will show you what I got so far. while true do local t = script.Parent local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent local money = player.leaderstats:WaitForChild("Money") t.Text = "$"..money.Value.."" wait() end How can I add commas? Anyone know? ~iiMitchie
darthpyro
#184084108Sunday, February 21, 2016 5:50 PM GMT

As I said, use this function. function comma_value(amount) local formatted = amount while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k==0) then break end end return formatted end ... t.Text = "$" .. comma_value(money.Value)
Aethex
#184084128Sunday, February 21, 2016 5:50 PM GMT

Stop reposting. You already have a thread: http://forum.roblox.com/Forum/ShowPost.aspx?PostID=184082574

    of     1