1

I am having an input box of type number in my html page in that it allows multiple decimal places rather than accepting only one decimal place can anyone tell me why it occurs like this and how to overcome this issue.

Html:

<input stopccp focus-me class="inputContainer" type="number" name=""
       ng-model="vm.total_amount[$index]" ng-change="vm.onTotalCost()"
       limit-char limit="5">
zgue
  • 3,793
  • 9
  • 34
  • 39
Nidhin Kumar
  • 3,278
  • 9
  • 40
  • 72
  • 1
    Possible duplicate of [Allow 2 decimal places in ](https://stackoverflow.com/questions/34057595/allow-2-decimal-places-in-input-type-number) –  Sep 06 '17 at 06:34
  • Hope this help! [Make an html input display 2 decimal places](https://stackoverflow.com/questions/14862009/make-an-html-number-input-always-display-2-decimal-places) – Treesa Sep 06 '17 at 06:55

1 Answers1

0

You Simply Add:

** step = ".01"**

<input type="number" class="form-control" id="interest" placeholder="Interest" step=".01">

I Thinks That Should Work in Your case.

Devesh
  • 929
  • 12
  • 10