1.0.1 • Published 2 years ago

@jsep-plugin/numbers v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm size

@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);

Meta

LICENSE (MIT)