On Mon, 06 Apr 2009, [email protected] wrote:
Hi,
> 2009-04-06 19:35 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
> * harbour/source/rtl/hbstrfmt.c
> + added precision support for %s and %d.
> COMMENT: I've used GNU printf() function for test. Some of
> formats is not supported by it. For example, zero padding is
> ignored if left alignment is used, etc. I'm not sure if it is
> intentional.
It is. From printf() man page:
0 The value should be zero padded. For d, i, o, u, x, X, a, A, e,
E, f, F, g, and G conversions, the converted value is padded on
the left with zeros rather than blanks. If the 0 and - flags
both appear, the 0 flag is ignored. If a precision is given
with a numeric conversion (d, i, o, u, x, and X), the 0 flag is
ignored. For other conversions, the behavior is undefined.
But please also remember that flag precedence may depend on type of
conversion.
In hb_snpritf() I tried to replicate the explicitly defined and also some
undocumented modifier precedences.
It will be good to fully replicate it also in the .prg SPRINTF wrapper.
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour