@billyjbryant/num-to-name
v0.0.3
Published
Converts a provided positive integer to its fully qualified name
Downloads
6
Readme
Number to Name
num-to-name
is a nodeJs module that provides an easy way to convert a provided positive integer into it's fully qualified name.
The motivation for this module was born from a Google search which led to this answer on StackOverflow.
The code is based on a similar solution found in https://www.npmjs.com/package/number2text which is intended for Indian Currency with optional English Language variant. I intend to expand to addition
Installation:
npm install --save @billyjbryant/num-to-name
Usage:
Example:
const numToName = require('@billyjbryant/num-to-name');
console.log(numToName(22));
// Twenty-Two
console.log(numToName(222));
// Two-Hundred-Twenty-Two
console.log(numToName(222, " "));
// Two Hundred Twenty-Two
console.log(numToName(222, '_'));
// Two_Hundred_Twenty-Two
console.log(numToName(2222));
// Two-Thousand-Two-Hundred-Twenty-Two