A slight improvement over an exact latex check would be to append the number with a digit and then check its numeric value.
e.g. appending 1 to the string would make 3→ 3.1 and 3.00→ 3.001, etc.
My preference would be to err on the permissive side, but if you must know that a student entered 2 dp you can use mod with this hack to get what you want.
Note: A HUGE reason why this isn’t totally recommended is that its still very easy to mark students wrong for things like 1.00+2.00 or other expressions. Though if you’re careful about blocking and error messages you can work around this.