numeral-systems

3.2.1 • Public • Published

NUMERAL SYSTEMS - converts numbers by numerals system types ..


imed-jaberi

Build Status Coverage Status NPM version License Code Size

Easy, blaze and tiny module to convert any type of numbers to other type you want.

Installation

# npm
$ npm install numeral-systems
# yarn
$ yarn add numeral-systems

Usage

This is a practical example of how to use.

const numeralSystems = require("numeral-systems");
const result = numeralSystems("2019", "Arabic");

console.log(result);
// ۲۰۱۹

NOTE: In case the number is a modern type, you can enter the number to the function in number type like this;

const numeralSystems = require("numeral-systems");
const result = numeralSystems(2019, "Arabic"); // 2019 not '2019'

console.log(result);
// ۲۰۱۹
You can check the test folder for all possible cases.

Some Informations

In this module we have 7 numerals systems. You can convert between them ..

  • Arabic : ٠ , ١ , ٢ , ٣ , ٤ , ٥ , ٦ , ٧ , ٨ , ٩ , ١٠ ...
  • Khmer : ០ , ១ , ២ , ៣ , ៤ , ៥ , ៦ , ៧ , ៨ , ៩ ...
  • Lao : ໐ , ໑ , ໒ , ໓ , ໔ , ໕ , ໖ , ໗ , ໘ , ໙ ...
  • Modern : 1 , 2 , 3 4 , 5 , 6 , 7 , 8 , 9 , 10 ...
  • Persian : ٠ , ١ , ٢ , ٣ ,۴, ۵ , ۶ , ٧ , ٨ , ٩ , ١٠ ...
  • Romain ( Romain IN [ 1 .. 3999] ) : I , II , III , IV , V , VI , VII , VIII , IX , X ...
  • Thai : ๐ , ๑ , ๒ , ๓ , ๔ , ๕ , ๖ , ๗ , ๘ , ๙ ...

NOTE: Al-Khwarizmi put the modern numeral system for that is considered the original Arabic and this for the scientific secretariat, but we relied on the Arabic numerals very old under the name "Arabic" and the numerls system developed by Al-Khwarizmi "modern" ...

Support

If you have any problem or suggestion please open an issue.

License


MIT © Imed Jaberi

Package Sidebar

Install

npm i numeral-systems

Weekly Downloads

5

Version

3.2.1

License

MIT

Unpacked Size

13.6 kB

Total Files

5

Last publish

Collaborators

  • 3imed-jaberi