expresso
  • Get Started
    • 👋Welcome!
    • ⚡Quick Start
  • Expresso Library
    • 📖Introduction
    • ⚛️expresso-core
      • Currency
      • Random String
      • Formatter
      • File
      • Phone
    • ⚓expresso-hooks
      • Multer
      • Token
      • OTP
    • 🚀expresso-provider
      • FCM
      • SMTP
      • Redis
      • Storage
    • 🔗expresso-query
      • TypeORM
      • Sequelize
Powered by GitBook
On this page
  • Format with national currency symbol
  • Format nominal
  1. Expresso Library
  2. expresso-core

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'
Previousexpresso-coreNextRandom String

Last updated 1 year ago

⚛️