Created
August 22, 2022 21:13
-
-
Save ricardov03/34d9983ce1604a0c683d1db5bdc458e9 to your computer and use it in GitHub Desktop.
People underestimate the power of HTML. Here's how to allow decimals on HTML number fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- How to allow Number fields to include decimals? | |
| Use the step attribute. By reducing the default step to .01 | |
| you unleash the decimals allocation on Number fields. --> | |
| <input type="number" step=".01" name="test" /> | |
| <!-- Do you need more Decimal places? Add more zeros. | |
| You can include more leading positions by adding more left | |
| zeros. --> | |
| <input type="number" step=".001" name="test" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment