[Haskell-beginners] is there a better way to ask for a hex formatted number?
daniel.is.fischer at googlemail.com
Fri Apr 29 23:23:30 CEST 2011
On Friday 29 April 2011 23:11:01, Sean Perry wrote:
> I am using this currently:
> makeHex n = "0x" ++ map toUpper (showHex n "") -- gives me 0xFF for
> I know i can use printf but I am not sending this to output when I am
> doing the formatting.
printf can also produce Strings:
Prelude Text.Printf> printf "0x%x" 239 :: String
Prelude Text.Printf> printf "0x%X" 239 :: String
More information about the Beginners