Use Dialog Result As Variable For Repeat Loop

I have a dialog prompt asking how many times to click a certain element in the Numbers formatting panel, but it keeps telling me the result is not an integer. I’ve tried explicitly setting it as such but keep getting the same error. Would be nice to also ensure the entry is a number and not a text string, and if the latter to not proceed or tell the user to try again.

tell application "System Events"
	tell application process "Numbers"
		set clickNumber to display dialog "How many clicks?" default answer "" as integer
		tell window 1
			repeat clickNumber times
				click UI element 1 of incrementor 2 of scroll area 3
			end repeat
		end tell
	end tell
end tell

Because the line where clickNumver acquires the value from the dialog lacks the labeled parameter text returned

set clickNumber to (text returned of display dialog "How many clicks?" default answer "") as integer

That works great. Many thanks.