summaryrefslogtreecommitdiff
path: root/Monky/Examples/Utility.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Monky/Examples/Utility.hs')
-rw-r--r--Monky/Examples/Utility.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Monky/Examples/Utility.hs b/Monky/Examples/Utility.hs
index ca22579..f59ee69 100644
--- a/Monky/Examples/Utility.hs
+++ b/Monky/Examples/Utility.hs
@@ -40,6 +40,7 @@ import Formatting
import Control.Monad (unless)
import Control.Concurrent (threadWaitRead)
+import Data.Scientific (fromFloatDigits, FPFormat(Exponent))
import System.Posix.Types (Fd)
import Monky.Modules
@@ -84,7 +85,7 @@ convertUnitT rate step bs ks ms gs
| rate < fromIntegral (gf * 10 ) = sformat ((left 4 ' ' %. fixed 2) % stext) gv gs
| rate < fromIntegral (gf * 100 ) = sformat ((left 4 ' ' %. fixed 1) % stext) gv gs
| rate < fromIntegral (gf * 1000) = sformat ((left 4 ' ' %. fixed 0) % stext) gv gs
- | otherwise = sformat ((left 4 ' ' %. expt 1) % stext) gv gs
+ | otherwise = sformat ((left 4 ' ' %. scifmt Exponent Nothing) % stext) (fromFloatDigits gv) gs
where
kf = 1 * step
mf = kf * step