helper function to convert a text input to a number based on the number type
default error state for invalid numbers
default validator that simply ensures, that the input is a valid number of type T