1.0.0 • Published 1 year ago

@ikilote/num-formatter v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Number Formatter

Small library to transform names according to patterns.

npm version Downloads MIT license

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.

1.0.0

1 year ago