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

How would I make this so it shows the numbers with commas?

Asked by 10 years ago

Any way this can show with commas?

PlayerPointsMessage.Text = "Available Points: " ..PointsService:GetAwardablePoints()

Can post whole script if needed.

1 answer

Log in to vote
1
Answered by
SirNoobly 165
10 years ago

It would be complicated. The script you gave wouldn't work, GetAwardablePoints() returns an int not a string so you'd have to:

PlayerPointsMessage.Text = "Available Points: " .. tostring(PointsService:GetAwardablePoints())

A way of doing it would be checking the string.len, say if it returns 6 you would do this:

local points = tostring(PointsService:GetAwardablePoints)
if string.len(points) == 6 then
PlayerPointsMessage.Text = "Available Points: " .. string.sub(points, 6, 4) .. ", " .. string.sub(points, 3, 1)
end

String manipulation for all the things you can do with strings.

0
Doesn't seem to be working. Pawsability 65 — 10y
0
It's just an example of how to go about doing it. SirNoobly 165 — 10y
Ad

Answer this question