[Haskell-cafe] Best way to format a number

Shachaf Ben-Kiki shachaf at gmail.com
Tue Nov 20 22:41:31 EST 2007


On Nov 20, 2007 7:07 PM, Don Stewart <dons at galois.com> wrote:
> You can work around it for now with:
>
>     Prelude Text.Printf> printf "%02d\n" 3 >> return ()
>     03

It may be simpler to specify the type explicitly:

Prelude Text.Printf> printf "%02d\n" 3 :: IO ()
03

    Shachaf


More information about the Haskell-Cafe mailing list