vue-number-format
Easy formatted numbers, currency and percentage with input/directive mask for Vue.js
Features
- Lightweight < 2kb
- Dependency free
- Mobile support
- Component or Directive flavors
- Accept copy/paste
- Editable
Usage
A. Globally
B. Use as component
C. Use as directive
Must use vmodel.lazy
to bind works properly.
Properties
property | Required | Type | Default | Description |
---|---|---|---|---|
precision | false | Number | 2 | How many decimal places |
decimal | false | String | "." | Decimal separator |
separator | false | String | "," | Thousands separator |
prefix | false | String | "" | Currency symbol followed by a Space, like "$ " |
suffix | false | String | "" | Percentage for example: " %" |
masked | false | Boolean | false | If the component output should include the mask or not |