diff options
author | Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@gmail.com> | 2007-07-10 16:14:06 +0200 |
---|---|---|
committer | Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@gmail.com> | 2007-07-10 16:14:06 +0200 |
commit | 6eabba5d8f8912450b264e2fc345493791e0b2d8 (patch) | |
tree | 2b4a27d4a481ca1081ada4559bdb26e10bfb32a4 /Monitors | |
parent | 5c921f697f74e7f369119be9c7c78a4f503913d7 (diff) | |
download | xmobar-6eabba5d8f8912450b264e2fc345493791e0b2d8.tar.gz xmobar-6eabba5d8f8912450b264e2fc345493791e0b2d8.tar.bz2 |
Fix takeDigits so it doesn't use read.
darcs-hash:20070710141406-ba08c-d44de14cd4aba85d042f5b7cd3be22469d994353.gz
Diffstat (limited to 'Monitors')
-rw-r--r-- | Monitors/Common.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Monitors/Common.hs b/Monitors/Common.hs index 9706eac..390f383 100644 --- a/Monitors/Common.hs +++ b/Monitors/Common.hs @@ -288,7 +288,8 @@ type Pos = (Int, Int) takeDigits :: Int -> Float -> Float takeDigits d n = - read $ showFFloat (Just d) n "" + fromIntegral ((round (n * fact)) :: Int) / fact + where fact = 10 ^ d floatToPercent :: Float -> String floatToPercent n = |