@jsep-plugin/numbers
v1.0.2
Published
Adds support for binary, hex, and octal number formats, including _
Downloads
19,286
Readme
@jsep-plugin/numbers
A JSEP plugin for adding support for additional number formats, hexadecimal, binary and octal. It also adds support to ignore _ characters in numbers
jsep('0xA'); // hexadecimal (10)
jsep('0b01001010'); // binary (74)
jsep('0644'); // octal (420)
jsep('0o644'); // octal (420)
jsep('115_200'); // decimal (115200)
Install
npm install @jsep-plugin/numbers
# or
yarn add @jsep-plugin/numbers
Usage
import jsep from 'jsep';
import jsepNumbers from '@jsep-plugin/numbers';
jsep.plugins.register(jsepNumbers);