This is a helper that convert a number to a string like the way a real Vietnamese read it.
Registry | Status | Tooling | Tests |
---|---|---|---|
NPM | LGTM | ||
GPR | Test Coverage | ||
Maintainability | |||
Known Vulnerabilities |
# npm
npm i read-vn-number
# yarn
yarn add read-vn-number
https://github.com/hckhanh/read-vn-number/packages
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ỷ
MIT © Khanh Hoang