I am trying to end a quick form using jQuery, which should add 0 to the decimal point if the decimal character is the first char entered in the input.
For example, .25 would be 0.25 before submitting the form. However, 2.05 will remain at 2.05, and 0 will not be added.
Is there a simple function here that could help me? I would rather write something long and detailed if it is not needed.
Also, here is the input box I am asking for help for reference
<input type="number" name="dailygain" id="dailygain" />
source share