Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 593 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 593 Bytes

"money" AngularJs Directive

This directive validates monetary inputs in "42.53" format (some additional work is needed for "32,00" Europoean formats). Note that this is not designed to work with currency symbols. It largely behaves like Angular's implementation of type="number".

It does:

  • format the input field and enforces 2 decimal places on blur
  • default to positive numbers. Set min=-Infinity to allow negative values
  • prevent entering non-numeric characters
  • prevent entering the minus sign when min >= 0

Usage:

input(
  money
  min=1
  max=100
)