1.0.1 • Published 8 years ago

number-bytes v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

number-bytes

Build Status npm version

Get Number(double) bytes string.

As you know JavaScript save a Number as a Double-precision floating-point

usage

npm install number-bytes

in your .js file

var numberBytes = require('number-bytes');

console.log(numberBytes(1));
//0011111111110000000000000000000000000000000000000000000000000000

console.log(numberBytes(1,{
    radix : 16,
    separate : ','
}));
//3f,f0,00,00,00,00,00,00

options

radix : the base to use for representing numeric values 2,10 and 16 was optioned default to be 2.

separate : separate between each byte.

tips: when radix equals 2 or 16 , the width of each byte to dispaly was fixed to 4( for radix 2 ) or 2( for radix 16 ).

LICENSE

MIT