summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrepgoal.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/repgoal.hs b/repgoal.hs
index d8624e5..2170073 100755
--- a/repgoal.hs
+++ b/repgoal.hs
@@ -95,7 +95,9 @@ computeOneRepMax :: Performance -> Rational
95computeOneRepMax Achieved{..} = achievedWeight * (realToFrac achievedReps * 0.0333 + 1) 95computeOneRepMax Achieved{..} = achievedWeight * (realToFrac achievedReps * 0.0333 + 1)
96 96
97showRational :: Rational -> String 97showRational :: Rational -> String
98showRational = printf "%.3f" . (realToFrac :: Rational -> Float) 98showRational n = printf format $ (realToFrac :: Rational -> Float) $ n
99 where
100 format = if floor (n * 10) `mod` 10 == (0 :: Integer) then "%.0f" else "%.2f"
99 101
100drawUI :: () -> [Widget ()] 102drawUI :: () -> [Widget ()]
101drawUI () = [a] 103drawUI () = [a]