convert-money-to-text
Convert money (number) to text
Table of Contents
Why?
I found a solution to convert money into text characters
Installation
$ npm i trans-money-to-text -S
or
$ yarn add trans-money-to-text
Functions
Take a look into the usage section for a detailed example.
convertMoneyToText
Note: you can also use the default export.
This function converts money to text value (string).
Syntax
Returns a number or NaN.
const number = convertMoneyToText(value);
Parameters
- value: number
Usage
An example how to use it.
const { convertMoneyToText } = require('trans-money-to-text') // name export
const convertMoneyToText = require('convert-string-to-number'); // default export
const text = convertMoneyToText('2000'); // => 2 nghìn đồng
License
MIT © Lukas Aichbauer