PHP 4.0 Bug #4912: floating number truncated
| From: | oliviers at mnet dot fr | Date: | Thu, 08 Jun 2000 17:10:43 +0000 |
| Subject: | PHP 4.0 Bug #4912: floating number truncated | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-20584@lists.php.net to get a copy of this message | ||
From: oliviers@mnet.fr
Operating system: Windows 2000 french
PHP version: 4.0.0 Release
PHP Bug Type: Scripting Engine problem
Bug description: floating number truncated
Well, i got a little problem with php4 final under windows (nt4 and 2000) french with french local
properties. Let's see an example!
eg:
$valueFranc = 120;
$valueEuro = $valueFranc / 6.55957;
$valueEuro equals 20 (120 / 6 in fact)
the value of Euro was truncated because in France, the decimal separator is a coma (not a dot)
when i change the number 6.55957 by the string "6,55957", it works fine :
$valueEuro = $valueFranc / "6,55957";
$valueEuro equals 18,293882068489
i've used setlocale to change the local properties for decimal separator.
setlocale(LC_NUMERIC,"En");
It works with the string "6.55957" but not with the number 6.55957
Can i change something in php.ini to define the decimal separator for numbers (not string) ?
I got this problem with the value of 1 Euro in Franc but i'll get same errors for all my float
numbers :(
Best regards