From c5935766faa0327880ed078f5f9149217046a2e5 Mon Sep 17 00:00:00 2001 From: jonnytest1 Date: Thu, 28 Feb 2019 14:07:07 +0100 Subject: [PATCH 1/2] fixed line percentage displayed as NaN --- src/parser.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.coffee b/src/parser.coffee index d31f839..59d00f5 100644 --- a/src/parser.coffee +++ b/src/parser.coffee @@ -20,7 +20,7 @@ summarizeSection = (section) -> # for non-zero counts compute a percentage from 0 to 100 with 1 decimal of precision, otherwise specify -1 if total isnt 0 - section.percentage = Math.round(hit / total * 1000) / 10 + section.percentage = Math.round(section.hit / section.total * 1000) / 10 else section.percentage = -1 From afb2a5e09e4dc1910dc962dab32fc25178b77d04 Mon Sep 17 00:00:00 2001 From: jonnytest1 Date: Thu, 28 Feb 2019 14:25:44 +0100 Subject: [PATCH 2/2] added section to total comparison --- src/parser.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.coffee b/src/parser.coffee index 59d00f5..9727060 100644 --- a/src/parser.coffee +++ b/src/parser.coffee @@ -19,7 +19,7 @@ summarizeSection = (section) -> section.total = total # for non-zero counts compute a percentage from 0 to 100 with 1 decimal of precision, otherwise specify -1 - if total isnt 0 + if section.total isnt 0 section.percentage = Math.round(section.hit / section.total * 1000) / 10 else section.percentage = -1