Coder Social home page Coder Social logo

orkhan-huseyn / number-to-azerbaijani-word Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 0.0 3.29 MB

Say numbers in Azerbaijani using JavaScript

Home Page: https://www.npmjs.com/package/number-to-azerbaijani-word

License: MIT License

JavaScript 100.00%
azerbaijani-translation numbers javascript number-to-word

number-to-azerbaijani-word's Introduction

Number to Azerbaijani word GitHub license Travis build report Codecov report Bundle siz

Installation

The library has been designed to convert any integer or double to its Azerbaijani description. You can add it to your node project by writing:

npm install number-to-azerbaijani-word --save or yarn add number-to-azerbaijani-word

Usage

To use the library in your NodeJS project, import it in your file and call spellNumberInAz function.

const numberSpelling = require('number-to-azerbaijani-word');

const { spellNumberInAz } = numberSpelling;

console.log(spellNumberInAz(0)); // output: 'sıfır'

console.log(spellNumberInAz(-738)); // output: 'mənfi yeddi yüz otuz səkkiz'

console.log(spellNumberInAz(990999)); // output: 'doqquz yüz doxsan min doqquz yüz doxsan doqquz'

console.log(spellNumberInAz(-1234567));
// output: 'mənfi bir milyon iki yüz otuz dörd min beş yüz altmış yeddi'

console.log(spellNumberInAz(Number.MAX_SAFE_INTEGER));
// doqquz kvadrilyon yeddi trilyon yüz doxsan doqquz milyard iki yüz əlli dörd milyon yeddi yüz qırx min doqquz yüz doxsan bir

Usage with ES6 imports:

import React from 'react';
import { spellNumberInAz } from 'number-to-azerbaijani-word';

export default function App() {
  return (
    <div>
      <h1>{spellNumberInAz(123)}</h1>
    </div>
  );
}

If you want to use it in the browser then ES5 bundled version is available in NPM CDN. Simple, add following script to your HTML file and use it.

<script src="https://unpkg.com/[email protected]/dist/number-to-az-word.umd.min.js"></script>
<script>
  console.log(spellNumberInAz(66)); // output: 'altmış altı'

  console.log(spellNumberInAz(-31)); // output: 'mənfi otuz bir'
</script>

Contribution

Please do not hesitate report issues, send pull requests about the code that you think is wrong or could be written better.

number-to-azerbaijani-word's People

Contributors

dependabot[bot] avatar orkhan-huseyn avatar

Stargazers

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