Skip to content

ashusharmadev/devnagri-numerals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Devnagri numerals

It converts Arabic numerals to Devnagri

Installation

# for NPM
npm install devnagri-numerals
# for Yarn
yarn add devnagri-numerals
# for Bower
bower add devnagri-numerals

Functions

toDevnagriNumeral(arabicNumeral)

  • Parameters: arabicNumeral should be of type number
  • Returns: string

toArabicNumeral(devnagriString)

  • Parameters: devnagriString should be of type string
  • Returns: number

Usage

  • Import it
const devnagriConvertor = require('devnagri-numerals');

Or for Babel Node

import * as devnagriConvertor from "devnagri-numerals";
  • Convert Arabic to Devnagri
var devnagri_nums = devnagriConvertor.toDevnagriNumeral(232);
  • Convert Devnagri to Arabic
var arabic_nums = devnagriConvertor.toArabicNumeral('१३७८४');

Build or Test

npm install
npm run test