Hello,

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.

Yes. Thank You, for information. I found (and implemented) both cases of ignored 0 flag in my tests.

But please also remember that flag precedence may depend on type of
conversion.


This is no problem, since a separate "case TYPE:" is used in code for each conversion type, so precedence can be managed locally for each type.


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.

Yes. Though only good tests shows the exact algorithm of sprintf(). Please, tell if you find some incompatibilities in hb_strformat() behaviour.


Regards,
Mindaugas
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to