Skip to content

Commit

Permalink
Round category values in renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Apr 5, 2017
1 parent a3736d0 commit 1b3504c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lighthouse-core/report/v2/report-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ReportGeneratorV2 {
return Object.assign({}, audit, {result, score: auditScore});
});

const categoryScore = Math.round(ReportGeneratorV2.arithmeticMean(audits));
const categoryScore = ReportGeneratorV2.arithmeticMean(audits);
return Object.assign({}, category, {audits, score: categoryScore});
});
const overallScore = ReportGeneratorV2.arithmeticMean(categories);
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/report/v2/report-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class ReportRenderer {
_renderCategory(category) {
const element = this._dom.createElement('div', 'lighthouse-category');
// TODO: use precision when it's on category.score.
const score = {value: category.score, precision: 'numeric'};
const score = {value: Math.round(category.score), precision: 'numeric'};
element.appendChild(
this._renderAuditScore(score, category.name, category.description, category));
for (const audit of category.audits) {
Expand All @@ -307,7 +307,7 @@ class ReportRenderer {
}

// TODO: use precision when it's on audit.score.
const score = {value: audit.score, precision: 'binary'};
const score = {value: audit.score, precision: 'numeric'};

element.appendChild(this._renderAuditScore(score, title, audit.result.helpText, audit));

Expand Down

0 comments on commit 1b3504c

Please sign in to comment.