note 55369 deleted from function.number-format by levim
| From: | levim@php.net | Date: | Sun, 23 Mar 2014 14:15:14 +0000 |
| Subject: | note 55369 deleted from function.number-format by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199023@lists.php.net to get a copy of this message | ||
Note Submitter: astrolox at lawyersonline dot co dot uk
----
Users should be aware of the following behaviour.
I'm not sure if this is a PHP bug, libc bug, or if it's even a bug at all. So I thought
I'd make a comment and allow everyone else to make up their own minds.
FreeBSD 4.3 PHP 4.3.3
<?php
// the comments show the output generated by this script
echo "input 8.525 output = ". number_format( 8.525, 2, '.', "")
."\n";
echo "input 8.525 output = ". number_format(8.525, 2, '.', "")
."\n";
// input 8.525 output = 8.53
// input 8.525 output = 8.53
$a = 483.00;
$b = 0.175;
$c = $a * $b;
echo "input \$c = $c type ". gettype($c) ." output = ". number_format( $c, 2,
'.', "") ."\n";
// input $c = 84.525 type double output = 84.52
$d = 17.5;
$e = ( $a / 100 ) * $d;
echo "input \$e = $e type ". gettype($e) ." output = ". number_format( $e, 2,
'.', "") ."\n";
// input $e = 84.525 type double output = 84.53
echo "input 63.745 output = ". number_format(63.745, 2, '.', "")
."\n";
echo "input 64.745 output = ". number_format(64.745, 2, '.', "")
."\n";
echo "input 65.745 output = ". number_format(65.745, 2, '.', "")
."\n";
// input 63.745 output = 63.74
// input 64.745 output = 64.75
// input 65.745 output = 65.75
?>