Browse thread
sprintf-Bug?
-
Oliver Bandel
-
Jonathan Roewen
-
Oliver Bandel
- Jonathan Roewen
- Oliver Bandel
- Christophe TROESTLER
-
Oliver Bandel
-
Jonathan Roewen
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Christophe TROESTLER <Christophe.Troestler+ocaml@u...> |
| Subject: | Re: [Caml-list] sprintf-Bug? |
On Sun, 4 Feb 2007, Oliver Bandel <oliver@first.in-berlin.de> wrote:
>
> And "%0s" should make it with a filling-char '0'
> instead of filling-chars ' '.
No, reread the documentation:
- [0]: for numerical conversions, pad with zeroes instead of spaces.
^^^^^^^^^^^^^^^^^^^^^^^^^
%s is not a numerical conversion
> Or how to make hex-output with filling '0' instead
> of ' ' for two-char length strings?
Printf.sprintf "%02X" 12
You have to tell the length here otherwise no filling is necessary.
ChriS