Angular Formatted Number Input
Simple angular directive to format numbers in input elements. When displaying
the numbers are formatted using standard thousand-separators like: 123,456.
When editing, numbers are free of any formatting.
Since HTML5 input[type=number] does not allow comma characters, we recommend
that you use it with type=tel or type=text.
HTML5 Validation support
Supports all standard HTML5 input[type=number] validations such as:
- Number (according to this floating point spec
- Mininum (use the
minordata-minattribute) - Maximum (use the
maxordata-maxattribute)
Extra attributes
In addition to HTML5 number validation, there is one extra attribute:
- Precision
data-precision=[number]: set the precision of the floating point value. Defaults to 0.
Demo
Usage
angular.module('myApp', ['hongy']);<input type="tel" data-number>Contribute
- Fork
- Clone
- Write tests
- Make sure it conforms to coding style present in the source code
- Make sure all tests pass and cover all aspects of your code
- Send a pull request
