Giter Site home page Giter Site logo

n2words's Introduction

n2words

Node CI Coverage Status npm

n2words converts numbers to words. It supports multiple languages.

n2words is a lightweight, easy to use package, with no dependencies. It works both in Node.js and in browsers.

Install

npm install n2words

n2words is available on jsDelivr.

Usage

CommonJS

var n2words = require('n2words')

ES6

import n2words from 'n2words'
// or to import source ES Modules without bundle and polyfills
import n2words from 'n2words/src/n2words.mjs'

Browser

<script src="n2words.min.js"></script>

Example

n2words(123)                 // 'one hundred and twenty-three'

n2words(123, {lang: 'en'})   // 'one hundred and twenty-three'
n2words(123, {lang: 'fr'})   // 'cent vingt-trois'
n2words(123, {lang: 'es'})   // 'ciento veintitrés'

Supported Languages

  • en (English, default)
  • ar (Arabic)
  • cz (Czech)
  • dk (Danish)
  • de (German)
  • es (Spanish)
  • fr (French)
  • he (Hebrew)
  • it (Italian)
  • ko (Korean)
  • lt (Lithuanian)
  • lv (Latvian)
  • no (Norwegian)
  • pl (Polish)
  • pt (Portuguese)
  • ru (Russian)
  • tr (Turkish)
  • uk (Ukrainian)

License

MIT

n2words's People

Contributors

forzagreen avatar rivamarco avatar tylervigario avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.