Format large numbers with dots (in europe) instead of commas

I’ve a display in my game that shows the amount of cash you have, I want to display large numbers. So I want the numbers to be sepperated with dots. But only found a way to do it with commas.

What I have:
€ 10000 → € 10,000

What I want:
€ 10000 → € 10.000

The script I found:

local function Format(amount)
	while true do
		amount, k = string.gsub(amount, "^(-?%d+)(%d%d%d)", '%1,%2')
		if (k==0) then
			break
		end
	end
	return amount
end

I believe thats a comma in the third parameter, try replacing it with a dot/period.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.