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

Latest commit

 

History

History
61 lines (40 loc) · 3.63 KB

README.md

File metadata and controls

61 lines (40 loc) · 3.63 KB

read-vn-number

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

Unit Tests

Current Status

Registry Status Tooling Tests
NPM Publish NPM Package LGTM Language grade: JavaScript
GPR Publish GPR Package Test Coverage Test Coverage
Maintainability Maintainability
Known Vulnerabilities Known Vulnerabilities

Installation

# npm
npm i read-vn-number

# yarn
yarn add read-vn-number

GitHub Package Registry (GPR)

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

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