@ikilote/num-formatter
v1.0.0
Published
Small library to transform names according to patterns.
Downloads
1
Readme
Number Formatter
Small library to transform names according to patterns.
Installation
npm i @ikilote/num-formatter --save
Usage
Example num-formatter
import { NumFormatter } from '@ikilote/num-formatter';
console.log(new NumFormatter(156.156).formatByPattern('#,000.0#'));
// 156.17
console.log(new NumFormatter(156.156).formatByPattern('#,000.0000'));
// 156.1560
console.log(new NumFormatter(156.156).formatByPattern('#0,00.0000', { dot: ',', separator: ' ' }));
// 1 56,1560
console.log(new NumFormatter(156.156).format({ dot: ',', decimalSize: 2 }));
// 156,16
Publishing the library
npm run build:lib
npm run publish:lib
License
This module is released under the permissive MIT license. Your contributions are always welcome.