[fpc-devel] Format with zero padding
Michael Van Canneyt
michael at freepascal.org
Tue Jun 20 13:18:37 CEST 2006
On Tue, 20 Jun 2006, Micha Nelissen wrote:
> Hi,
>
> How can I zero-pad using Format ? In C, using printf it's done using an
> extra 0 digit in for the width: '%04d' with parameter 3 will print
> '0003'. Wouldn't this be useful for FPC's Format as well, or is there
> another way ?
in fpc it's a dot.
Try
%.4d
This is in the docs:
http://www.freepascal.org/docs-html/rtl/sysutils/format.html
Michael.
More information about the fpc-devel
mailing list