JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q29122F
  • License ISC

convert currency or any numbers to corresponding words, eg: 1 -> "one", 10 -> "ten", 101 -> "one hundred and one" etc...

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (currency-in-words) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    currency-in-words

    Convert currency or any number formats to respective words


    Note


    | 1. Current version supports only indian system. But, subsequent versions will support international version.| | 2. Commas in the test cases are just for readability, but doesn't support in the input. |


    Installation:

    npm i currency-in-words

    Usage:

    import { convert } from 'currency-in-words'
    
    const result = convert('777')

    Refer the images(test-cases) for more insight.

    Adding test-case results just to make your life easier..

    As we know it's hard to define the scope of a software. The scalability it offers is also a potential danger, as we might end up in a forever loop, adding feature after feature. Hence couple of limitations has been set going forth.

    1. Ignoring all decimals after two decimal places.
    2. Never going to address/handle commas in the input.
    3. Out put for decimals is in the format 'xxx yyy zzz.xx yy' without any spaces on either sides of the period, this is probably not gonna change for the sake of backward compatability. But you can always manipulate it with a little bit of your code.