Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

hckhanh/read-vn-number

Repository files navigation

read-vn-number

This is a helper that convert a number to a string like the way a real Vietnamese read it.

Warning

This package is no longer maintained, please migrate to the new package: https://jsr.io/@hckhanh/vn-number/doc/~/readVnNumber

Unit Tests Language grade: JavaScript deepcode Known Vulnerabilities Publish NPM Package Publish GPR Package

Installation

# npm
npm i read-vn-number

# yarn
yarn add read-vn-number

# pnpm
yarn add read-vn-number

# jsr
npx jsr add @hckhanh/read-vn-number
yarn dlx jsr add @hckhanh/read-vn-number
pnpm dlx jsr add @hckhanh/read-vn-number

GitHub Package Registry (GPR)

https://github.com/hckhanh/read-vn-number/packages

Usage

Import and use in ES6+:

import readNumber from 'read-vn-number'
// import readNumber from '@hckhanh/read-vn-number' // (if you are using jsr)

readNumber('19990000') // or readNumber(19990000)
// output: mười chín triệu chín trăm chín mươi nghìn

or commonjs way:

const readNumber = require('read-vn-number')

readNumber('100000000')
// output: một trăm triệu

License

MIT © Khanh Hoang