price-to-letters

A JavaScript tool that converts numeric prices to letters.

Usage no npm install needed!

<script type="module">
  import priceToLetters from 'https://cdn.skypack.dev/price-to-letters';
</script>

README

price-to-letters

Publish Status npm version Downloads

A JavaScript tool that converts price number to letters.

Usage

run npm install price-to-letters, and then

let c = require('price-to-letters');
c.spell(1); // 'One Dollar'

works on two decimal places, up to 999 trillion (c.spell(999999999999999)).

TODOs

  • [ ] add French localization;
  • [ - ] space handling;

Credits

This tool is based on a piece of visual basic code provided by Microsoft for Excel (source). Created by Jiacheng Jiang.