Skip to content

Working with BigInts

Nevtep edited this page Aug 14, 2014 · 4 revisions

The big-number Directive

To support Int64 numbers on a ng-model property just add the attribute big-number to an input[text] making sure that no other directive overrides the ng-model value.

Validations

Validating that the input is a valid BigNumber comes by default, you can set min and max attribute to have the validated accordingly.

BigNumber Manipulation

There are some things to take into account when representing a model property as a BigNumber:

  • The BigNumber object has various methods for comparison that need to be used instead of normal operands for accuracy.
  • When converted to a String BigNumbers add quotes, you can use the numeral directive for a better display.
Clone this wiki locally