When you do a project, you need to restrict the contents of the input box to enter only two decimal places.
First of all to limit the number can only be entered, this is very good implementation, using the following code can be
<span style= "FONT-SIZE:14PX;" > <input type= "number" ng-model= "interest" name= "interest" required/></span>
Required: This input box is required
Type=number: Only integers can be entered
How do I allow two decimal places to be entered?
We need to use the Step property (step is the meaning of step)
- for now,
step
the browser is ie10+, Chrome and Opera browser.
The following small section contains
step
HTML code for the property:
<span style= "FONT-SIZE:14PX;" > <input type= "number" step= "0.01" ng-model= "interest" name= "interest" required/></span>
How to enter three decimal digits, this step=0.001, and so on
How to limit the number of decimal digits in the input box of type number in Angularjs