numeral-systems
v3.2.1
Published
easy, blaze and tiny module to convert any type of numbers to other type you want.
Downloads
24
Maintainers
Readme
NUMERAL SYSTEMS - converts numbers by numerals system types ..
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.