How to put default text in input field to be number?

I have a input field in which i have entered the default text value to be zero. However when the user doesn’t add any value in that input field, the value of that field is saved as “0”(as a text and not as a number). But the type of the input field is set as number not text. How can i fix this?

If you are using code, please share here in a code block so we can what you are doing.

I have just connected a input field to a database in front end. In settings of input field i have selected type of data as ‘number’ and the default value as 0 and have unchecked both ‘read only’ and ‘required’ fields. So that if the user doesn’t enter these fields, it gets filled as 0. But in the content manager when i am looking in the data, these fields when unfilled are taking values as ‘0’; a text value. I wanted to solve this problem.