pretty-bytes
Advanced tools
Comparing version 5.1.0 to 5.2.0
@@ -56,2 +56,3 @@ 'use strict'; | ||
const exponent = Math.min(Math.floor(Math.log10(number) / 3), UNITS.length - 1); | ||
// eslint-disable-next-line unicorn/prefer-exponentiation-operator | ||
number = Number((number / Math.pow(1000, exponent)).toPrecision(3)); | ||
@@ -58,0 +59,0 @@ const numberString = toLocaleString(number, options.locale); |
{ | ||
"name": "pretty-bytes", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "Convert bytes to a human readable string: 1337 → 1.34 kB", | ||
@@ -16,6 +16,7 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && NODE_ICU_DATA=node_modules/full-icu ava" | ||
"test": "xo && NODE_ICU_DATA=node_modules/full-icu ava && tsd" | ||
}, | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
@@ -39,6 +40,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"ava": "*", | ||
"ava": "^1.4.1", | ||
"full-icu": "^1.2.1", | ||
"xo": "*" | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -41,5 +41,5 @@ # pretty-bytes [![Build Status](https://travis-ci.org/sindresorhus/pretty-bytes.svg?branch=master)](https://travis-ci.org/sindresorhus/pretty-bytes) | ||
### prettyBytes(input, [options]) | ||
### prettyBytes(number, [options]) | ||
#### input | ||
#### number | ||
@@ -52,3 +52,3 @@ Type: `number` | ||
Type: `Object` | ||
Type: `object` | ||
@@ -55,0 +55,0 @@ ##### signed |
6639
5
92
4