io:format and integers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

io:format and integers

Jouni Rynö-2
While I was again formatting my outputs I started to wonder:
What's the reason, that io:format does not contain integer (a'la %d/%i
in C) formats ? I need it so often, that I must be missing something
totally obvious ...
io:fwrite("~2..0s", [integer_to_list(7)]) works to write 07, but having
a sign is a  bit more complicated :-)

As I already asked for hex (~h, ~H as they might be), could there be ~d
also ?

With regards
        Jouni


  Jouni Ryn?                            mailto://Jouni.Ryno/
                                        http://www.geo.fmi.fi/~ryno/
  Finnish Meteorological Institute      http://www.fmi.fi/
  Geophysical Research                  http://www.geo.fmi.fi/
  P.O.BOX 503                           Tel      (+358)-9-19294656
  FIN-00101 Helsinki                    FAX      (+358)-9-19294603
  Finland                               priv-GSM (+358)-50-5302903
 
  "It's just zeros and ones, it cannot be hard"