npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nks-number-to-words

v1.7.0

Published

Number converter to words

Downloads

28

Readme

NumberToWords

Number converter to words

Download

  $ bower install nks-number-to-words;
  $ npm install nks-number-to-words --save;
  $ git clone https://github.com/konstantin-nizhinskiy/NumberToWords;

Location

Now support (ua,ru)

Function

| functions | README | | ------ | ------ | | get | Convert numbers | | getPrice | Convert sum with currency | | getDate | Convert date |

get

Number converter to words (support: 0 ... 999 999 999.9999999)

Arguments

| Params | type | README | | ------ | ------ | ------ | | number | {int/string} | number | | local | {string} | location |

getPrice

Convert sum with currency to words (support: 1 ... 999 999 999.99)

Arguments

| Params | type | README | | ------ | ------ | ------ | | number | {int/string} | sum | | local | {string} | location | | currency | {string} | currency | | options | {object} | dop property | | options.fractional_is_number | {boolean} | Do not convert fractional amount into words (default:false) |

Currency

| Currency | Currency number | | ------ | ------ | | USD | 840 | | UAH | 980 | | EUR | 978 | | RUR | 810 | | RUB | 643 | | PLZ | 616 | | PLN | 985 | | GBP | 826 | | CHF | 756 | | CZK | 203 | | CAD | 124 | | SEK | 752 | | NOK | 578 | | JPY | 392 | | ILS | 376 | | BYN | 933 | | KZT | 398 | | AUD | 036 | | GEL | 981 | | UZS | 860 | | MDL | 498 | | HUF | 348 | | CNY | 156 | | NZD | 554 | | AZN | 944 | | INR | 356 | | KGS | 417 | | DKK | 208 |

getDate

Date converter to words

Arguments

| Params | type | README | | ------ | ------ | ------ | | number | {string} | date | | local | {string} | location |

Formats date

| Formats | | ------ | | DD.MM.YYYY | | DD-MM-YYYY |

Example

<script src="dist/numberToWords.min.js"  type="text/javascript"></script>
<script src="dist/translations.ua.js"  type="text/javascript"></script>
<script type="text/javascript">
    console.log(numberToWords.get(123,'ua')); //сто двадцять три
    console.log(numberToWords.get(1,'ua')); //один
            
    console.log('UA getPrice: ',numberToWords.getPrice(23,'ua',"UAH"));//UA getPrice:    двадцять три гривні ноль копійок 
    console.log('UA getPrice 101.01: ',numberToWords.getPrice(101.01,'ua',"UAH"));//UA getPrice 101.01:    сто одна гривня одна копійка
    console.log('UA getPrice 101.11: ',numberToWords.getPrice(101.11,'ua',"UAH"));//UA getPrice 101.11:    сто одна гривня одинадцять копійок
    console.log('UA getPrice 101.20: ',numberToWords.getPrice(101.20,'ua',"UAH"));//UA getPrice 101.20:    сто одна гривня двадцять копійок 
    console.log('UA getPrice 101.21: ',numberToWords.getPrice(101.21,'ua',"UAH"));//UA getPrice 101.21:    сто одна гривня двадцять одна копійка
    console.log('UA getPrice 101.22: ',numberToWords.getPrice(101.22,'ua',"UAH"));//UA getPrice 101.22:    сто одна гривня двадцять двi копійки
    console.log('UA getPrice 102.22: ',numberToWords.getPrice(102.22,'ua',"UAH"));//UA getPrice 102.22:    сто двi гривні двадцять двi копійки
    console.log('UA getPrice 12.22: ',numberToWords.getPrice(12.22,'ua',"UAH"));//UA getPrice 12.22:    дванадцять гривень двадцять двi копійки
    console.log('UA getPrice 101.212: ',numberToWords.getPrice(101.212,'ua',"UAH"));//UA getPrice 101.212:    сто одна гривня 212 копійок
    console.log('UA getPrice 101.01: ',numberToWords.getPrice(101.01,'ua',"UAH",{"fractional_is_number":true})); //UA getPrice 101.01:    сто одна гривня 01 копійка
    console.log('UA getPrice 102: ',numberToWords.getPrice(102,'ua',"UAH"));//UA getPrice 102:    сто двi гривні ноль копійок 
    
    console.log('UA getPrice 101.24: ',numberToWords.getPrice(101.24,'ua',"840"));//UA getPrice 101.24:    сто одна долар двадцять чотири цента 
    console.log('UA getPrice 101.24: ',numberToWords.getPrice(101.24,'ua',"USD"));//UA getPrice 101.24:    сто одна долар двадцять чотири цента 
    
    console.log('UA: ',numberToWords.getDate("22.01.2012",'ua',1));//двадцять другого січня двi тисячі дванадцятого року 
    console.log('UA: ',numberToWords.getDate("22.01.2020",'ua',1));//двадцять другого січня двi тисячі двадцятого року 
    console.log('UA: ',numberToWords.getDate("22.01.2021",'ua',1));//двадцять другого січня двi тисячі двадцять першого року 
    console.log('UA: ',numberToWords.getDate("22.01.2012",'ua',0));//двадцять друге січня двi тисячі дванадцятого року 
    console.log('UA: ',numberToWords.getDate("22.01.2020",'ua',0));//двадцять друге січня двi тисячі двадцятого року 
    console.log('UA: ',numberToWords.getDate("22.01.2021",'ua',0));//двадцять друге січня двi тисячі двадцять першого року 
</script>

Translations

* numberToWords.ru
* numberToWords.ua