Miss any of our Open RFC calls?Watch the recordings here! ¬Ľ

any-to-any

2.1.1¬†‚Äʬ†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 ..

Limitation

This module can convert only the integers numbers between base 2 & base 36. Soon, it will be possible to convert real numbers [wip]

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')
 
const InputNumber  = '1110111' // 119 in decimal
const InputBase = 2
const OutputBase = 8
 
const result = Convert (InputNumber, InputBase, OutputBase)
console.log(result)
//  167
 
// NOTE: in case the input number is consists of numbers only,
// you can enter the number to the function in number type ..
const InputNumber  = 1110111 // 119 in decimal
const InputBase = 2
const OutputBase = 8
const result = Convert (InputNumber, InputBase, OutputBase); 
console.log(result);
//  167
 

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

License


MIT

Install

npm i any-to-any

DownloadsWeekly Downloads

24

Version

2.1.1

License

MIT

Unpacked Size

146 kB

Total Files

32

Last publish

Collaborators

  • avatar