npm

Need private packages and team management tools?Check out npm Orgs. »

any-to-any

1.5.1 • Public • Published

ANY-TO-ANY - converts numbers between bases ; binary , decimal , octal , hexadecimal and muche more ..


imed-jaberi Build Status

Coverage Status

The purpose of this module is to convert numbers from any base to other base you want ..
NOTE: you can send to me for add anything you want in instgram ..

Installation


  • NPM :
$ npm install any-to-any

Usage


The method of use is simple and very easy ... Just follow these steps :

Step 1 : Import the module in this way.

const { Convert } = require ('any-to-any') ;

Step 2 : Enter the input number , the input base and the output base you want to the function.

let InputNumber  = "1110111"; // 119 in decimal
let InputBase = 2 ;
let OutputBase = 8 ;
let result = Convert ( InputNumber , InputBase , OutputBase  );
console.log(`*****\n ${result} \n*****`);

Step 3 : Execute method to see the result ..

$your_pc_name_with_your_directory
*****
 167
*****
NOTE: in case the input number is consists of numbers only , you can enter the number to the function in number type .. so the step 2 will be :
let InputNumber  = 1110111; // 119 in decimal
let InputBase = 2 ;
let OutputBase = 8 ;
let result = Convert ( InputNumber , InputBase , OutputBase  ); 
console.log(`*****\n ${result} \n*****`);

Examples


There are a set of suggested examples that have been tested that you can follow here.

Some Informations :


Switching between bases numbers is becoming easier with this module .. This module can convert the integers numbers between base 2 & base 36 and soon it will be possible to convert real numbers ...

What new in the future ?


Develop the module more on the conversion in the large bases ...

License


MIT

install

npm i any-to-any

Downloadsweekly downloads

6

version

1.5.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability