> For the complete documentation index, see [llms.txt](https://marco-baratto.gitbook.io/number-format/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://marco-baratto.gitbook.io/number-format/number-format/get-started.md).

# Get Started

Import library with the following code:

```bash
npm i @marchintosh94/number-format
```

or

```bash
yarn add @marchintosh94/number-format
```

### Quick Start

When you have installed the package you can configure global initial parameters

{% code title="main.ts or index.ts" %}

```typescript
import { initNumberFormat } from '@marchintosh94/number-format'

// ...other code...

initNumberFormat({
  defaultDecimals: 2,
  defaultErrorValue: 0,
  delimitersChar: {
    decimal: '.',
    thousands: ','
  },
  defaultCurrecySymbol: {sign: '$', code: 'USD'}
})
```

{% endcode %}

Then you can format numbers in your application

```typescript
import { useNumberFormat } from '@marchintosh94/number-format'


useNumberFormat(2100.3).format() => // 2,100.30
useNumberFormat(890.32).formatCurrency() => // 800.32 $
```
