diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-26 15:10:12 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-26 15:10:12 -0400 |
commit | 849c183f23a68d6204d5aacd0b9750374a5f59b9 (patch) | |
tree | 68159ecbf967957d1468f8acd77b29394eeb6c58 /DataUnits.hs | |
parent | fd8cba164c180149127656070ac4a68bbe13b9cb (diff) |
tweak
Diffstat (limited to 'DataUnits.hs')
-rw-r--r-- | DataUnits.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/DataUnits.hs b/DataUnits.hs index a175b5f6a..c81c6e42e 100644 --- a/DataUnits.hs +++ b/DataUnits.hs @@ -11,6 +11,7 @@ module DataUnits ( memoryUnits, bandwidthUnits, oldSchoolUnits, + roughSize, compareSizes, readSize @@ -142,11 +143,10 @@ readSize units input where (number, rest) = head parsednum multiplier = head $ parsedunit + unitname = takeWhile isAlpha $ dropWhile isSpace rest parsednum = reads input :: [(Double, String)] - parsedunit = lookupUnit units unit - - unit = takeWhile isAlpha $ dropWhile isSpace rest + parsedunit = lookupUnit units unitname lookupUnit _ [] = [1] -- no unit given, assume bytes lookupUnit [] _ = [] |