Commit 88b92b82 authored by Ben Gamari's avatar Ben Gamari 🐢

Fix precision

parent 4d92937f
......@@ -133,9 +133,11 @@ data Relative a = Reference a
| Relative a
| NoReference
showRelative :: (Num a, Show a) => (a -> ShowS) -> Relative a -> String
showRelative :: (Ord a, RealFloat a, Show a)
=> (a -> ShowS) -> Relative a -> String
showRelative showRef (Reference n) = showRef n ""
showRelative _showRef (Relative n) = shows (100*n) "%"
showRelative _showRef (Relative n) = plus . showFFloat (Just 2) (100*n) $ "%"
where plus = if n > 0 then showChar '+' else id
showRelative _showRef NoReference = "no ref"
toRelativeChange :: (Ord r, Ord c, RealFrac a)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment