New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

num2txt

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

num2txt

Converts number to Vietnamese or English text with customized output.

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
99
-8.33%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

numbers

FAQs

Package last updated on 24 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts