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

Latest commit

 

History

History
52 lines (34 loc) · 1.27 KB

README.md

File metadata and controls

52 lines (34 loc) · 1.27 KB

read-vn-number

Read Vietnamese number like a Vietnamese

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

Test Coverage Maintainability Known Vulnerabilities

Installation

# npm
npm i read-vn-number

# yarn
yarn add read-vn-number

Usage

Import and use in ES6+:

import NumberReader from 'read-vn-number'

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

or commonjs way:

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

NumberReader.read('100000000')
// output: một trăm triệu

if you are working with TypeScript:

import NumberReader from 'read-vn-number/src/NumberReader'

NumberReader.read('1000000000')
// output: một tỷ

License

MIT © Khanh Hoang