Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

Any way this can show with commas?

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

Can post whole script if needed.

1 answer

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.

2 comments

0

Doesn't seem to be working.

0

It's just an example of how to go about doing it.

This discussion is preserved as it was. New answers, comments, and votes are closed.