Code Monkey home page Code Monkey logo

number-to-words-kg's Introduction

number-to-words-kg

Convert a number to words in the Kyrgyz language.

Install

Install with npm:

npm i number-to-words-kg

Install with yarn:

yarn add number-to-words-kg

Usage

var converter = require('number-to-words-kg');

converter.toWords(13); // => "Он үч сом 00 тыйын"

// Decimal numbers:
converter.toWords(2.9); // => "Эки сом 90 тыйын"

// Negative numbers:
converter.toWords(-3); // => "Минус үч сом 00 тыйын"

// Large numbers:
converter.toWords(9007199254740991); // => Тогуз квадриллион жети триллион бир жүз токсон тогуз миллиард эки жүз элүү төрт миллион жети жүз кырк миң тогуз жүз токсон бир сом 00 тыйын

// With options:
converter.toWords(123.5, { currency: 'KGS' }); // => "Бир жүз жыйырма үч сом 50 тыйын"
converter.toWords(0.5, { currency: 'RUB' }); // => "Ноль рубль 50 тыйын"
converter.toWords(34.5, {
    currency: 'USD',
    convertMinusSignToWord: true,
    showNumberParts: {
	integer: true,
        fractional: true
    },
    showCurrency: {
        integer: true,
        fractional: true
    },
    convertNumberToWords: {
	integer: true,
        fractional: false
    }
}); // => "Отуз төрт доллар 50 цент"

API

Methods

toWords(number, [options])

Converts a number into words.

Method arguments

number (string|number): A number that must be converted. In Javascript, a number type may range between -9007199254740991 and +9007199254740991.

Return value

(string): Returns the number converted to the text.

Default options object

{
    currency: 'KGS',
    convertMinusSignToWord: true,
    showNumberParts: {
        integer: true,
        fractional: true
    },
    showCurrency: {
        integer: true,
        fractional: true
    },
    convertNumberToWords: {
	integer: true,
        fractional: false
    }
}

number-to-words-kg's People

Contributors

azamatsoodaev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.