JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 319
  • Score
    100M100P100Q83859F
  • License MIT

A bunch of utility functions that work with number in Vietnamese language

Package Exports

  • vn-number
  • vn-number/package.json

Readme

vn-number 🇻🇳

🛠 A bunch of utility functions that work with number in 🇻🇳 Vietnamese language

NPM Downloads JSR

Features

  • Zero dependencies
  • Built-in support for Edge runtime
  • Typesafe with TypeScript
  • Fully documented

Functions

Read Vietnamese number

import { readVnNumber } from '@hckhanh/vn-number'

const result = readVnNumber(1250000)
console.log(result) // một triệu hai trăm năm mươi nghìn

Format number in Vietnamese format

import { formatVnNumber } from '@hckhanh/vn-number'

const result = formatVnNumber(1250000)
console.log(result) // 1.250.000

Format VN currency (VND - ₫)

import { formatVnCurrency } from '@hckhanh/vn-number'

const result = formatVnCurrency(1250000)
console.log(result) // 1.250.000 ₫

Format percentage in Vietnamese format

import { formatVnPercent } from '@hckhanh/vn-number'

const result = formatVnPercent(0.991)
console.log(result) // 99,1%

Release Notes

You can go to the Releases page to see the release notes.