‚̧Narwhals Playing Mahjong
Miss any of our Open RFC calls?Watch the recordings here! ¬Ľ

any-to-any

2.1.0¬†‚Äʬ†Public¬†‚Äʬ†Published

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


imed-jaberi

Build Status    Coverage Status    NPM version    License    Top Language    Code Size    Code of Conduct    PRs Welcome   

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

Installation

# npm .. 
$ npm install any-to-any
# yarn .. 
$ yarn add any-to-any

Usage

This is a practical example of how to use.

// const Convert = require ('any-to-any');
const { Convert } = require ('any-to-any');
 
let InputNumber  = '1110111'; // 119 in decimal
let InputBase = 2;
let OutputBase = 8;
 
let result = Convert (InputNumber, InputBase, OutputBase);
console.log(`*****\n ${result} \n*****`);
 
// $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 ..
let InputNumber  = 1110111; // 119 in decimal
let InputBase = 2 ;
let OutputBase = 8 ;
let result = Convert ( InputNumber , InputBase , OutputBase  ); 
console.log(`*****\n ${result} \n*****`);
 
// $your_pc_name_with_your_directory
// *****
//  167
// *****

NOTE: 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 ...

License


MIT

Install

npm i any-to-any

DownloadsWeekly Downloads

1

Version

2.1.0

License

MIT

Unpacked Size

146 kB

Total Files

32

Last publish

Collaborators

  • avatar