Permalink
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (15 sloc) 527 Bytes
import Data.Text ()
import Data.Double.Conversion.Text
import System.Environment
import System.Exit
import System.IO
main = do
args <- getArgs
case args of
("shortest":xs) -> print (map (toShortest . read) xs)
("fixed":n:xs) -> print (map (toFixed (read n) . read) xs)
("exponential":n:xs) -> print (map (toExponential (read n) . read) xs)
("precision":n:xs) -> print (map (toPrecision (read n) . read) xs)
_ -> do
hPutStrLn stderr "oops! no mode specified!"
exitWith (ExitFailure 1)