Description of problem: php 4.3.2 printf() float formatting is incorrect. How reproducible: printf("|%010.2f|\n",1234567.89); Actual results: |0001234567.89| Expected results: |1234567.89| Additional info: This is fixed in php 4.3.7 The PHP changelog for 4.3.7 didn't list any apparent fixed bugs that would correct this, but had this comment: Fixed problems with *printf() functions and '%f' formatting. (Marcus)
Thanks for the report. Unfortunately to fix this would be an interface change which would result in output changes to sites which rely on the current behaviour, so is not a change which could be made in a RHEL update. In case it's not clear, the 4.3.2 behaviour was to count only the length of the integer part towards the field width; so the workaround is to use a field width specifier N smaller than desired where N is equal to precision + 1 (1 for the radix). It is appreciated that it is awkward to use such a workaround for PHP code designed to be portable across multiple versions of PHP.