From fa5443124c7aded9698e7683eca1e5c31a550ed4 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 18 Dec 2011 03:17:38 +0100 Subject: New -d (decimal digits) monitor option (issue #58) --- src/Plugins/Monitors/Swap.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Plugins/Monitors/Swap.hs') diff --git a/src/Plugins/Monitors/Swap.hs b/src/Plugins/Monitors/Swap.hs index e466dbb..107eb1e 100644 --- a/src/Plugins/Monitors/Swap.hs +++ b/src/Plugins/Monitors/Swap.hs @@ -42,10 +42,11 @@ parseMEM = return [(tot - free) / tot, tot, tot - free, free] formatSwap :: [Float] -> Monitor [String] -formatSwap (r:xs) = - do other <- mapM (showWithColors (showDigits 2)) xs - ratio <- showPercentWithColors r - return $ ratio:other +formatSwap (r:xs) = do + d <- getConfigValue decDigits + other <- mapM (showWithColors (showDigits d)) xs + ratio <- showPercentWithColors r + return $ ratio:other formatSwap _ = return $ replicate 4 "N/A" runSwap :: [String] -> Monitor String -- cgit v1.2.3