Improve floating point scaling in UnitConverter.
commit3a2fd0b5db98fea60a1d0c380b74038d45ee7b85
authorEdward Z. Yang <edwardzyang@thewritingpot.com>
Fri, 24 Oct 2008 16:50:59 +0000 (24 12:50 -0400)
committerEdward Z. Yang <edwardzyang@thewritingpot.com>
Fri, 24 Oct 2008 16:50:59 +0000 (24 12:50 -0400)
treea9a78a1ecb54ddf264c4f48eb4898feef4cbe555
parent25fa53c15b37beead62d40e79f030364696da85a
Improve floating point scaling in UnitConverter.

When precision dictates that a number be zero padded, we cannot give sprintf()
a negative precision specifier.  This commit implements manual negative precision
printing of floats, taking into account common rounding errors with floating
point numbers.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
NEWS
library/HTMLPurifier/UnitConverter.php
tests/HTMLPurifier/UnitConverterTest.php
tests/index.php