note 57400 deleted from function.number-format by betz
| From: | betz@php.net | Date: | Mon, 03 Oct 2005 11:31:09 +0000 |
| Subject: | note 57400 deleted from function.number-format by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96290@lists.php.net to get a copy of this message | ||
Note Submitter: Robo
----
I've found the weirdest bug in PHP:-
<?php
// string value should still be ok
$weirdValue = '1762.00';
// set to uk price format
$weirdValue = number_format($weirdValue, 2, '.', ',');
// this is fine
echo $weirdValue;
// but this goes to 1.00 if you accidentally set this twice
echo number_format($weirdValue, 2, '.', ',')
?>
The second time you set number_format on this value it sets it to 1.00, i realise that this is a
string and its unlikely that this can happen but it still happened to one of my customer and it was
not good!!