Correctly sanitize number fields

You're currently treating all number fields as integers, however a number can be more than just an integer. This PR ensures a valid number while allowing for more than just integers to exist.

See also #380 - perhaps this would be a good place to truncate to a given number of decimals (default 0?)