Giter VIP home page Giter VIP logo

ka.js's Introduction

ka.js

Georgian language support for Node and browser.

Node usage

Install using:

npm install ka

and use:

var ka = require('ka');
ka.numberToString(100); // => ასი

Browser usage

Include ka.js file in script tag and use:

window.KA.numberToString(100); // => ასი

What's included?

There are currently three modules in this project:

  • mobile number operations,
  • translate between different character sets,
  • number to string representation.

Mobile numbers

You can compact mobile numbers before saving them in database:

ka.compactMobile('(599)422-451'); // => 599422451

and you can format mobile numbers before displaying them to user:

ka.formatMobile('599422451'); // => (599)422-451

Country code formatting is also supported:

ka.compactMobile('+995 599 422 451'); //=> 995599422451
ka.formatMobile('+995 599 422 451'); //=> (+995 599)422-451

Character sets

You can translate from old "GEO" charset to modern "KA" charset and vice versa.

ka.toGeo('დიმიტრი'); // => ÃÉÌÉÔÒÉ
ka.toKa('ÃÉÌÉÔÒÉ'); // => დიმიტრი

There is also ka.translate function which can be used for effective translation between arbitrary character sets.

Number to string representation

You can represent integers as strings:

ka.numberToString(100); // => ასი
ka.numberToString(999999999999999); // => ცხრაას ოთხმოცდა ცხრამეტი ტრილიონ ცხრაას ოთხმოცდა ცხრამეტი მილიარდ ცხრაას ოთხმოცდა ცხრამეტი მილიონ ცხრაას ოთხმოცდა ცხრამეტი ათას ცხრაას ოთხმოცდა ცხრამეტი

ka.js's People

Contributors

dimakura avatar

Stargazers

Luka Kvavilashvili avatar David Babunashvili avatar Nika avatar Levan Lotuashvili avatar Levan Velijanashvili 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.