mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
604848188b
zend_double_to_str() converts a double to string in the way that (string) would (using %.*H using precision). smart_str_append_double() provides some more fine control over the precision, and whether a zero fraction should be appeneded for whole numbers. A caveat here is that raw calls to zend_gcvt and going through s*printf has slightly different behavior for the degenarate precision=0 case. zend_gcvt will add a dummy E+0 in that case, while s*printf convert this to precision=1 and will not. I'm going with the s*printf behavior here, which is more common, but does result in a minor change to the precision.phpt test. |
||
---|---|---|
.. | ||
basic | ||
classes | ||
func | ||
lang | ||
output | ||
run-test | ||
security | ||
strings |