Skip to content

Commit 5254cc0

Browse files
committed
Fixing the upper boundary of 'precision'
1 parent 63abcfb commit 5254cc0

File tree

9 files changed

+77
-10
lines changed

9 files changed

+77
-10
lines changed

dist/filesize.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function filesize (arg, {
198198
if (precision > 0) {
199199
result[0] = result[0].toPrecision(precision);
200200

201-
if (result[0].includes(E)) {
201+
if (result[0].includes(E) && e < 8) {
202202
e++;
203203
d = base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e);
204204
val = num / d;

dist/filesize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function filesize (arg, {
194194
if (precision > 0) {
195195
result[0] = result[0].toPrecision(precision);
196196

197-
if (result[0].includes(E)) {
197+
if (result[0].includes(E) && e < 8) {
198198
e++;
199199
d = base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e);
200200
val = num / d;

dist/filesize.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/filesize.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/filesize.umd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function filesize (arg, {
194194
if (precision > 0) {
195195
result[0] = result[0].toPrecision(precision);
196196

197-
if (result[0].includes(E)) {
197+
if (result[0].includes(E) && e < 8) {
198198
e++;
199199
d = base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e);
200200
val = num / d;

dist/filesize.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)