1.0.0 • Published 3 years ago
@ikilote/num-formatter v1.0.0
Number Formatter
Small library to transform names according to patterns.
Installation
npm i @ikilote/num-formatter --saveUsage
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,16Publishing the library
npm run build:lib
npm run publish:libLicense
This module is released under the permissive MIT license. Your contributions are always welcome.
1.0.0
3 years ago