summaryrefslogtreecommitdiffhomepage
path: root/Monitors
diff options
context:
space:
mode:
authorKrzysztof Kosciuszkiewicz <k.kosciuszkiewicz@gmail.com>2007-07-10 16:14:06 +0200
committerKrzysztof Kosciuszkiewicz <k.kosciuszkiewicz@gmail.com>2007-07-10 16:14:06 +0200
commit6eabba5d8f8912450b264e2fc345493791e0b2d8 (patch)
tree2b4a27d4a481ca1081ada4559bdb26e10bfb32a4 /Monitors
parent5c921f697f74e7f369119be9c7c78a4f503913d7 (diff)
downloadxmobar-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.hs3
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 =