RFC: 6178739 - Formatter - Zero padding flag with zero width
david.dehaven at oracle.com
Thu Jun 27 05:55:39 UTC 2013
>> Specifically, I was referred to how C handles "%0.4f\n".
No width, decimal truncated (rounded? floored? I forgot which it is) to four digits.
>> printf("%0.4f\n", 56789.456789F);
> ^ ^ ^ ^ ^ ^ ^ ^
> "A leading zero in the width value is interpreted as the zero-padding flag mentioned above […]."
Only if there's a valid width following, which there isn't in the case above. Try "%016.4" with the above test. Note that the width is the *full* width of the entire field, including decimal point and following digits.
More information about the core-libs-dev