Get Started

Import library with the following code:

npm i @marchintosh94/number-format

or

yarn add @marchintosh94/number-format

Quick Start

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

main.ts or index.ts
import { initNumberFormat } from '@marchintosh94/number-format'

// ...other code...

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

Then you can format numbers in your application

Last updated