Wondering what’s next for npm?Check out our public roadmap! »

    numeral-systems

    3.0.0 • Public • Published

    NUMERAL SYSTEMS - converts numbers by numerals system types ..


    imed-jaberi

    Build Status Coverage Status NPM version License Code Size

    The purpose of this module is to convert any type of numbers to other type you want.

    Note: the package is lightweight but the attached picture is what makes the unit reach more than 400kb ..

    Installation

    # npm
    $ npm install koa-better-boom
    # yarn
    $ yarn add koa-better-boom

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

    License


    MIT © Imed Jaberi

    Install

    npm i numeral-systems

    DownloadsWeekly Downloads

    12

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    11.7 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar