[1..100]>>=pen #7353(2008/08/26 04:28 GMT) [ Haskell ] Rating0/0=0.00
無難に。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import List import Maybe units = " KMGTPEZY" k = 1024 humanReadable x | x < k = show x | otherwise = show a ++ "." ++ show b ++ [c] where (y,xs) = mapAccumL (\x c -> (div x k, (x,c))) (x*10) $ init units (z,c) = fromMaybe (y,last units) $ find ((<k*10).fst) xs (a,b) = divMod z 10 {- > humanReadable 123456789012345678901234567890 "102121.0Y" -}
Rating0/0=0.00-0+
[ reply ]
[1..100]>>=pen
#7353()
[
Haskell
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]