Currency

Library currency to simplify nominal formatting

Using commonjs

const { currency } = require('expresso-core')

Using ES6

import { currency } from 'expresso-core'

Format with national currency symbol

import { currency } from 'expresso-core'

const result = currency.format({
  nominal: 125000,
  options: { locale: 'id-ID', currency: 'IDR' },
})

console.log(result)

// output :
'Rp 125.000'

Format nominal

import { currency } from 'expresso-core'

const result = currency.format({ nominal: 125000 })

console.log(result)

// output :
'125.000'

Last updated