evaslims23
4 months ago

Decimal number in Form Validation/Insertion

Posted 4 months ago by evaslims23

Hi people. I want to automatically output a decimal number on insertion in a form. Let's say a person would like to insert the number 1000,00. What I want is after he types in 1 in the form the number to convert automatically to a decimal e.g. 1,00 and if he adds another 0 to then make it a 10,00 and so on.

The value is integer in the database and I am using a function to convert the integer to a decimal so I can display it in the frontend. So technically if the person has 15,99 product let's say the value in the database would be 1599. This I got covered, however the issue above I have not. Any ideas?

Please sign in or create an account to participate in this conversation.