Skip to content Skip to sidebar Skip to footer

Firefox - Input Type Number Hides Decimal Places

I got some inputs on a webform. I'm calculating things here. When I calculate stuff (using JS) I use .toFixed(2) function every time. In IE and Chrome Numbers are always shown with

Solution 1:

Solution based on the fiddle given by the OP in the comments section of the answer.

Change the test2 input type to text. And it'll work the way you want it to.

<inputtype="text"name="test2"id="test2"value=""readonly />

Solution 2:

Firefox sees your value as a string and not as a number, try setting value as 19(Without quotation marks) then using toFixed(2) should set the value to 19.00 for calculating stuff.

Post a Comment for "Firefox - Input Type Number Hides Decimal Places"