@ikilote/num-formatter
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i @ikilote/num-formatter

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

66.1 kB

Total Files

13

Last publish

Collaborators

  • zefling