--[=[
	Adds commas to a number. Not culture aware.
	@param number string | number
	@return string
]=]

function String.addCommas(number: string | number): string
	if type(number) == "number" then
		number = tostring(number)
	end

	local index = -1

	while index ~= 0 do
		number, index = string.gsub(number, "^(-?%d+)(%d%d%d)", '%1,%2')
	end

	return number
end

return String
