open-index/open-npm huggingface dataset:
npm package: @ikilote/num-formatter
Description: Small library to transform names according to patterns.
Author: Zéfling
Latest version: 1.0.0

# Number Formatter

Small library to transform names according to patterns.

[![npm version](https://badge.fury.io/js/@ikilote/num-formatter.svg)](https://badge.fury.io/js/@ikilote/num-formatter) [![Downloads](https://img.shields.io/npm/dm/@ikilote/num-formatter.svg)](https://www.npmjs.com/package/@ikilote/num-formatter) [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://git.ikilote.net/typescript/number-formatter/-/raw/main/LICENSE)

## Installation

```
npm i @ikilote/num-formatter --save
```

## Usage

### Example `num-formatter`

```typescript
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.