5.2.3 • Published 3 years ago
vmo-react-number-format v5.2.3
react-number-format
React Number Format is an input-formatter library with a sophisticated and light weight caret engine. It ensures that a user can only enter text that meets specific numeric or string patterns, and formats the input value for display.
Features
- Prefix, suffix and thousands separator.
- Input Masking.
- Format number in an input or format as a simple text.
- Custom pattern formatting.
- Custom formatting handler.
- Fully customizable
Demos
See the many DEMO sections in the documentation.
Install
Using npm
npm install react-number-formatUsing yarn
yarn add react-number-formatES6
Numeric Format
import { NumericFormat } from 'react-number-format';Pattern Format
import { PatternFormat } from 'react-number-format';Read the full documentation here
Migrate from v4 to v5
v4 doc
Development
- Clone the repository or download the zip
npm i -g yarnto download Yarnyarnto install dependenciesyarn startto run example server (http://localhost:8084/)yarn testto test changesyarn buildto bundle files
Testing
Test cases are written in jasmine and run by karma
Test files : /test/**/*.spec.js
To run test : yarn test