Skip to content

Commit

Permalink
Make 0% work
Browse files Browse the repository at this point in the history
  • Loading branch information
rianbotha committed Nov 20, 2019
1 parent b46cd98 commit 0f3e0c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rianbotha/coverage-summary",
"version": "1.1.3",
"version": "1.1.4",
"description": "Summarizes istanbul coverage report for specified folders.",
"main": "index.js",
"bin": {
Expand Down
1 change: 1 addition & 0 deletions src/format-percent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const formatThreshold = require('./format-threshold');

const formatPercent = (number, total) => {
if (number === 0 || total === 0) return formatThreshold('0%', 0);
const percent = Math.round(number / total * 100 * 100) / 100;
return formatThreshold(percent + '%', percent);
};
Expand Down

0 comments on commit 0f3e0c3

Please sign in to comment.