1

I am only having this issue on firefox, it works as expected on chrome.

If I have a number input with a value of "20.00" or 20.00 (as a string or number) it always shows 20 without the decimal spaces inside the input box.

I need the type="number" so avoid other inputs that aren't numbers because of internal calculations that are done after the input.

For example:

<label>Input with number value as string</label>
<input type="number" value="20.00" step="0.01">

<br>

Input with number value as number
<input type="number" value=20.00 step="0.01">

How can I have the value inside the input show with the 2 decimal values in firefox?

FutoRicky
  • 903
  • 2
  • 9
  • 22
  • 2
    See https://stackoverflow.com/questions/22641074/html5-number-input-always-show-2-decimal-places. It seems that there's no solution. Solutions like : `document.getElementById('input').addEventListener('change', function(e) { this.value = parseFloat(this.value).toFixed(2); });` don't work either. – Joulss Nov 28 '17 at 21:23
  • 1
    Damn, this seems like a firefox issue that they should address. – FutoRicky Nov 29 '17 at 13:28

0 Answers0