Instead of step="any"
, which allows for any number of decimal places, use step=".01"
, which allows up to two decimal places.
More details in the spec: https://www.w3.org/TR/html/sec-forms.html#the-step-attribute
More Related Contents:
- How can I set max-length in an HTML5 “input type=number” element?
- Why does the html input with type “number” allow the letter ‘e’ to be entered in the field?
- How to make HTML input tag only accept numerical values?
- Is there any way to prevent input type=”number” getting negative values?
- How can I make the HTML5 number field display trailing zeroes?
- Make Input Type=”Password” Use Number Pad on Mobile Devices
- How to write fraction value using html?
- Force decimal point instead of comma in HTML5 number input (client-side)
- HTML5 input box with type=”number” does not accept comma in Chrome browser
- Two divs side by side – Fluid display [duplicate]
- Can I write a CSS selector selecting elements NOT having a certain class or attribute?
- Open link in new tab or window [duplicate]
- Vertical Text Direction
- Is it sometimes bad to use ?
- How to add an image to an event with Microdata meta tag?
- How can apply multiple background color to one div
- how to display a javascript var in html body
- HTML5 – How to stream large .mp4 files?
- Why doesn’t CSS ellipsis work in table cell?
- Converting HTML to XML
- HTML5 validation when the input type is not “submit”
- Bug With Firefox – Disabled Attribute of Input Not Resetting When Refreshing
- Overlay on HTML5 Fullscreen Video
- Centering floating divs within another div
- Detecting ‘transform: translate3d’ support
- Responsive order confirmation emails for mobile devices?
- Valid to use (anchor tag) without href attribute? [duplicate]
- Content Security Policy: “img-src ‘self’ data:”
- HTML5: camera access
- How to get the text from the HTML5 input field error message in Selenium?