0.1.2 • Published 2 years ago

num2txt v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

num2txt

Converts number to Vietnamese or English text with customized output.

Installation

npm install num2txt

or

yarn add num2txt

Basic Usage

import num2txt from 'num2txt'

num2txt('32') // Ba mươi hai
num2txt('32', { lang: 'en' }) // Thirty two
num2txt('32000', { lang: 'vi', currencyUnit: 'đồng' }) // Ba mươi hai nghìn đồng
num2txt('32000', { lang: 'vi', textTransform: 'capitalizeWords' }) // Ba Mươi Hai Nghìn
num2txt('87654321', { lang: 'vi', commaSeparator: true }) // Tám mươi bảy triệu, sáu trăm năm mươi tư nghìn, ba trăm hai mươi mốt

Options

OptionTypeDefaultDescription
langLanguage'vi'Output text language, default to Vietnamese; Language = 'vi' \| 'en'
textTransformTextTransformProps'capitalizeFirstLetter'Text transform style TextTransformProps = 'capitalizeWords' \| 'capitalizeFirstLetter' \| 'uppercase' \| 'lowercase'
currencyUnitstringundefinedUnit of currency
commaSeparatorbooleanfalseComma separator in output text

License

MIT

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago