Skip to content

Commit ef6d76e

Browse files
TeamopKeen Yee Liau
authored and
Keen Yee Liau
committed
fix(@angular-devkit/build-angular): improve bundle size value displaying
1 parent bd33f64 commit ef6d76e

File tree

1 file changed

+2
-2
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files/utilities

1 file changed

+2
-2
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/utilities/stats.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export function formatSize(size: number): string {
1818
}
1919

2020
const abbreviations = ['bytes', 'kB', 'MB', 'GB'];
21-
const index = Math.floor(Math.log(size) / Math.log(1000));
21+
const index = Math.floor(Math.log(size) / Math.log(1024));
2222

23-
return `${+(size / Math.pow(1000, index)).toPrecision(3)} ${abbreviations[index]}`;
23+
return `${+(size / Math.pow(1024, index)).toPrecision(3)} ${abbreviations[index]}`;
2424
}
2525

2626

0 commit comments

Comments
 (0)