Match not finding Decimal properly

Hi, I’m trying to make my own price input system, and I’m trying to make the decimal button.
Here’s my current code:

local this = script.Parent
local PriceNumber = this.PriceNumber
local function addnumber(input)
	local convert = tostring(input)
	if PriceNumber.Text == "$0.00" then
		PriceNumber.Text = "$"..input
	else
		PriceNumber.Text = PriceNumber.Text..input
	end
end

this.decimal.Button.MouseButton1Click:Connect(function()
	local decimalCheck = tostring(PriceNumber.Text)
	if decimalCheck:match(".") then
		print("Has decimal already!")
	else addnumber(".")
	end
end)

No matter what, it always says there’s a decimal already. I have tried with different characters other than a decimal, and it seems to work.

I’ve looked around to see if there’s another way to index the decimal, but I came up empty handed.
If anyone could help me out I would greatly appreciate it. Thank you!

I might be wrong but I think to view a period in match you need to put a %. Otherwise it takes the period as a “any character type”

decimalCheck:match("%.")

% is used to escape this as a special, and set as a literal period.

1 Like

Yeah, that’s what I was thinking it was doing. Thank you so much!