Skip to content

Commit

Permalink
Round module type percentages to two decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsobol committed Oct 6, 2024
1 parent a2fdbb0 commit 97fcbb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-numbers-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"sonda": patch
---

Round module type percentages to two decimal places
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ const formats = $derived.by( () => {
return formats;
} );
const esmPercentage = $derived( Math.round( formats.esm / data.uncompressed * 100 ) );
const cjsPercentage = $derived( Math.round( formats.cjs / data.uncompressed * 100 ));
const unknownPercentage = $derived( Math.round( formats.unknown / data.uncompressed * 100 ) );
const esmPercentage = $derived( Math.round( formats.esm / data.uncompressed * 10000 ) / 100 );
const cjsPercentage = $derived( Math.round( formats.cjs / data.uncompressed * 10000 ) / 100);
const unknownPercentage = $derived( Math.round( formats.unknown / data.uncompressed * 10000 ) / 100 );
const dependencies = $derived.by<Array<string>>( () => {
const packageNameRegExp = /(?:.*node_modules\/)(@[^\/]+\/[^\/]+|[^\/]+)/;
Expand Down

0 comments on commit 97fcbb3

Please sign in to comment.