chocolate-cake

A utility that converts standard Javascript numbers into their spoken word string based representations


Keywords
number, string, text, written, word, words, convert, utility, helper, human, spoken, library, npm-package, typescript-library
License
ISC
Install
npm install chocolate-cake@1.1.2

Documentation

Chocolate Cake 🍫 🎂 🍰 🍨 😋 😵

npm version

typescript code style prettier commitizen friendly

What 🤔

A utility that converts standard Javascript numbers into their spoken word string based representations.

The system recursively iterates through a supplied number and builds up corresponding string that has accurate punctuation and formatting for direct integration into your application.

For example, 1036 would be converted into "One thousand and thirty six".

Why 🤓

Creating friendlier and more intuitive user interfaces is increasingly critical in producing an inclusive application. Utilities like this are "delight" based enhancements that add extra polish to a given scenario.

Demo 😎

Try out the CodePen demo or easily experiment inside your own application with the Installation and Usage instructions below.

chocolate-cake-standard

Installation 🤖

Install the module from NPM .

npm install --save fish-tacos

Import the module into your project.

import chocolateCake from "chocolate-cake";

Usage 💾

Simply pass in a number and get back the respective string.

chocolateCake(1036); // One thousand and thirty six

Negative Values 🎊

In release v1.1.0 we have added support for negative values.

chocolate-cake-negative

chocolateCake(-3210); // Negative three thousand, two hundred and ten

Decimal Values 🎉

In release v1.1.0 we have added support for decimal values.

chocolate-cake-decimal

chocolateCake(12.34); // Twelve point three, four

Typescript 👍

This utility also supports Typescript

chocolate-cake-typescript

Limitations 🎛 🎚

This utility can convert values up-to-the trillions increment.

chocolateCake(123456789012345); // One hundred and twenty three trillion, four hundred and fifty six billion, seven hundred and eighty nine million, twelve thousand, three hundred and forty five

License 📜

MIT