Socket
Socket
Sign inDemoInstall

bytes

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bytes - npm Package Compare versions

Comparing version 0.3.0 to 1.0.0

5

History.md
1.0.0 / 2014-05-05
==================
* add negative support. fixes #6
0.3.0 / 2014-03-19

@@ -3,0 +8,0 @@ ==================

10

index.js

@@ -35,8 +35,8 @@

function convert (b) {
var tb = ((1 << 30) * 1024), gb = 1 << 30, mb = 1 << 20, kb = 1 << 10;
if (b >= tb) return (Math.round(b / tb * 100) / 100) + 'tb';
if (b >= gb) return (Math.round(b / gb * 100) / 100) + 'gb';
if (b >= mb) return (Math.round(b / mb * 100) / 100) + 'mb';
if (b >= kb) return (Math.round(b / kb * 100) / 100) + 'kb';
var tb = ((1 << 30) * 1024), gb = 1 << 30, mb = 1 << 20, kb = 1 << 10, abs = Math.abs(b);
if (abs >= tb) return (Math.round(b / tb * 100) / 100) + 'tb';
if (abs >= gb) return (Math.round(b / gb * 100) / 100) + 'gb';
if (abs >= mb) return (Math.round(b / mb * 100) / 100) + 'mb';
if (abs >= kb) return (Math.round(b / kb * 100) / 100) + 'kb';
return b + 'b';
}

@@ -9,3 +9,3 @@ {

},
"version": "0.3.0",
"version": "1.0.0",
"main": "index.js",

@@ -12,0 +12,0 @@ "dependencies": {},

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc