If the input is a number field, then you would not be able to detect the difference between 12.0 and 12

However, if it is a string field, then you can check the format of the input.
You also need to transform the string into a number in order to check for it's value.