> %% Int_to_hex(Integer)
> %% Convert an integer to a hexadecimal string...
> int_to_hex(N) when N < 10 -> [N+$0];
> int_to_hex(N) when N < 16 -> [N-10+$a];
> int_to_hex(N) ->
> int_to_hex(N div 16) ++
> int_to_hex(N - (N div 16)*16).
> int_to_Hex(N) when N < 10 -> [N+$0];
> int_to_Hex(N) when N < 16 -> [N-10+$A];
> int_to_Hex(N) ->
> int_to_Hex(N div 16) ++
> int_to_Hex(N - (N div 16)*16).
>----- Original Message -----
>> If it's going to be late Christmas season, and one could make some
>> wishes, what about hex-output for io:format
>Yes. I have always needed this. I use ~h and ~H. With the patch below you
>> io:format("~h 0x~H 16#~h\n", [51966, 51966, 51966]).
>cafe 0xCAFE 16#cafe
Seems reasonable. I'll add it. My only small qualm is that the
coupling ~h/~H does not mean the same thing as ~w/~W and ~p/~P, but I
suppose there is not real problem here.
There should be probably be a matching hex-input flag for io:fread. I
suppose I had better do that one as well.