0.0.3 • Published 1 year ago

@billyjbryant/num-to-name v0.0.3

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
1 year ago

Number to Name

GitHub package.json version npm (scoped) GitHub GitHub top language GitHub issues npm

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