UNPKG

936 BMarkdownView Raw
1[npm]: https://img.shields.io/npm/v/@jsep-plugin/numbers
2[npm-url]: https://www.npmjs.com/package/@jsep-plugin/numbers
3[size]: https://packagephobia.now.sh/badge?p=@jsep-plugin/numbers
4[size-url]: https://packagephobia.now.sh/result?p=@jsep-plugin/numbers
5
6[![npm][npm]][npm-url]
7[![size][size]][size-url]
8
9# @jsep-plugin/numbers
10
11A JSEP plugin for adding support for additional number formats, hexadecimal, binary and octal.
12It also adds support to ignore _ characters in numbers
13
14```javascript
15jsep('0xA'); // hexadecimal (10)
16jsep('0b01001010'); // binary (74)
17jsep('0644'); // octal (420)
18jsep('0o644'); // octal (420)
19jsep('115_200'); // decimal (115200)
20```
21
22## Install
23
24```console
25npm install @jsep-plugin/numbers
26# or
27yarn add @jsep-plugin/numbers
28```
29
30## Usage
31```javascript
32import jsep from 'jsep';
33import jsepNumbers from '@jsep-plugin/numbers';
34jsep.plugins.register(jsepNumbers);
35```
36
37## Meta
38
39[LICENSE (MIT)](/LICENSE)