Also, I just want to say, if you are allowing user input, it is better to force the user to only input valid information instead of fixing their input after. In this case, where the user types in a value, if you only want numbers, use a number input field instead of a text input field. Then, you have less to be concerned about. In Construct, there is a type property in the text input object.