Skip to content

Commit

Permalink
Added toLocalString for better number formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet committed Jan 30, 2017
1 parent ff3c21a commit 209d8cd
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -75,11 +75,12 @@ class CompressesResponses extends Audit {

totalWastedBytes += gzipSavings;
const url = URL.getDisplayName(record.url);
const totalKb = Math.round(originalSize / KB_IN_BYTES);
const totalKb = originalSize / KB_IN_BYTES;
const gzipSavingsKb = gzipSavings / KB_IN_BYTES;
results.push({
url,
total: `${totalKb} KB`,
gzipSavings: `${Math.round(100 * gzipSize / originalSize)}%`,
total: `${totalKb.toLocaleString()} KB`,
gzipSavings: `${gzipSavingsKb.toLocaleString()} KB`,
});

return results;
Expand All @@ -105,7 +106,7 @@ class CompressesResponses extends Audit {
tableHeadings: {
url: 'URL',
total: 'Original (KB)',
gzipSavings: 'GZIP Savings (%)',
gzipSavings: 'GZIP Savings (KB)',
}
}
}
Expand Down

0 comments on commit 209d8cd

Please sign in to comment.