diff --git a/tools/gulp/tasks/payload.ts b/tools/gulp/tasks/payload.ts index 7c002324574..70fd6996206 100644 --- a/tools/gulp/tasks/payload.ts +++ b/tools/gulp/tasks/payload.ts @@ -93,10 +93,10 @@ async function calculatePayloadDiff(database: firebaseAdmin.database.Database, c // Calculate the payload diffs by subtracting the previous size of the FESM ES2015 bundles. const cdkFullSize = currentPayload.cdk_fesm_2015; - const cdkDiff = cdkFullSize - previousPayload.cdk_fesm_2015; + const cdkDiff = roundFileSize(cdkFullSize - previousPayload.cdk_fesm_2015); const materialFullSize = currentPayload.material_fesm_2015; - const materialDiff = materialFullSize - previousPayload.material_fesm_2015; + const materialDiff = roundFileSize(materialFullSize - previousPayload.material_fesm_2015); // Set the Github statuses for the packages by sending a HTTP request to the dashboard functions. await Promise.all([ @@ -174,3 +174,8 @@ function getCommitFromPreviousPayloadUpload(): string { return spawnSync('git', ['rev-parse', process.env['TRAVIS_BRANCH']]).stdout.toString().trim(); } } + +/** Rounds the specified file size to two decimal places. */ +function roundFileSize(fileSize: number) { + return Math.round(fileSize * 100) / 100; +}