aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Interface.hs
diff options
context:
space:
mode:
authorWillem Van Onsem <3482343+KommuSoft@users.noreply.github.com>2020-12-08 18:26:55 +0100
committerGitHub <noreply@github.com>2020-12-08 18:26:55 +0100
commit39996e2d2ef4b69706bf279a75575bde240b1f1f (patch)
treefd583c159151a38f6a4d54313714c230cf19599e /haddock-api/src/Haddock/Interface.hs
parent96a60e218b35df611ee56c4bdd8408ec4375e6ca (diff)
simplify calculating percentages fixing #1194 (#1236)
Diffstat (limited to 'haddock-api/src/Haddock/Interface.hs')
-rw-r--r--haddock-api/src/Haddock/Interface.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs
index d1e1dae1..6dcfa594 100644
--- a/haddock-api/src/Haddock/Interface.hs
+++ b/haddock-api/src/Haddock/Interface.hs
@@ -182,7 +182,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do
liftIO $ mapM_ putStrLn (nub msgs)
dflags <- getDynFlags
let (haddockable, haddocked) = ifaceHaddockCoverage interface
- percentage = floor (fromIntegral haddocked * 100 / fromIntegral haddockable :: Double) :: Int
+ percentage = div (haddocked * 100) haddockable
modString = moduleString (ifaceMod interface)
coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked haddockable modString
header = case ifaceDoc interface of