summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/Monitors/Common.hs')
-rw-r--r--Plugins/Monitors/Common.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs
index a102036..6729397 100644
--- a/Plugins/Monitors/Common.hs
+++ b/Plugins/Monitors/Common.hs
@@ -35,6 +35,7 @@ module Plugins.Monitors.Common (
, parseTemplate
-- ** String Manipulation
-- $strings
+ , padString
, showWithColors
, showWithColors'
, showPercentsWithColors
@@ -296,7 +297,7 @@ showDigits d n =
showWithUnits :: Int -> Int -> Float -> String
showWithUnits d n x
| x < 0 = "-" ++ showWithUnits d n (-x)
- | n > 3 || x < 10^d = show (round x :: Int) ++ units n
+ | n > 3 || x < 10^(d + 1) = show (round x :: Int) ++ units n
| x <= 1024 = showDigits d (x/1024) ++ units (n+1)
| otherwise = showWithUnits d (n+1) (x/1024)
where units = (!!) ["B", "K", "M", "G", "T"]