diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-04 02:03:48 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-04 02:03:48 +0200 |
commit | 290f3520cd1d4b675b928b935e579686c3daf236 (patch) | |
tree | 164acaa225c4748ebcb8d6064ca342fe7471a818 | |
parent | c6a089e448a8c270b106eb862419c4a49982e9d4 (diff) | |
download | xmobar-290f3520cd1d4b675b928b935e579686c3daf236.tar.gz xmobar-290f3520cd1d4b675b928b935e579686c3daf236.tar.bz2 |
Weather plugin: accept temperatures with decimal points
darcs-hash:20071004000348-a5988-9c568e8d696b344f66f42b0e0993e76f3c591632.gz
-rw-r--r-- | Plugins/Monitors/Weather.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Plugins/Monitors/Weather.hs b/Plugins/Monitors/Weather.hs index cc3a58b..38577bc 100644 --- a/Plugins/Monitors/Weather.hs +++ b/Plugins/Monitors/Weather.hs @@ -71,11 +71,11 @@ pTime = do y <- getNumbersAsString return (y, m, d ,([h]++[hh]++":"++[mi]++mimi)) pTemp :: Parser (Int, Int) -pTemp = do f <- manyTill digit $ char ' ' +pTemp = do f <- manyTill (digit <|> char '.') $ char ' ' manyTill anyChar $ char '(' c <- manyTill digit $ (char ' ' <|> char '.') skipRestOfLine - return $ (read c, read f) + return $ (floor (read c :: Double), floor (read f :: Double)) pRh :: Parser Int pRh = do s <- manyTill digit $ (char '%' <|> char '.') |