diff options
-rwxr-xr-x | repgoal.hs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -95,7 +95,9 @@ computeOneRepMax :: Performance -> Rational | |||
95 | computeOneRepMax Achieved{..} = achievedWeight * (realToFrac achievedReps * 0.0333 + 1) | 95 | computeOneRepMax Achieved{..} = achievedWeight * (realToFrac achievedReps * 0.0333 + 1) |
96 | 96 | ||
97 | showRational :: Rational -> String | 97 | showRational :: Rational -> String |
98 | showRational = printf "%.3f" . (realToFrac :: Rational -> Float) | 98 | showRational 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 | ||
100 | drawUI :: () -> [Widget ()] | 102 | drawUI :: () -> [Widget ()] |
101 | drawUI () = [a] | 103 | drawUI () = [a] |