Bug #17079: setlocale changes the internal representation of floats
From: jonathan@tricolon.com
Operating system: Red Hat Linux 7.1
PHP version: 4.1.2
PHP Bug Type: Feature/Change Request
Bug description: setlocale changes the internal representation of floats
If I set my locale to Dutch in my php-script that converts currencies for a
Dutch site, I noticed that also the internal representation of floats
change as well. In Europe an amount of tenthousand dollars is written as
follows: $10.000,00 unlike the USA $10,000.00
So if I set the locale to "nl_NL" the internal representation of a float
with a point to seperate the integer part from the decimals (for example:
$amount = 68.123) is changed to a representation of a comma ','. I would
like to see it changed because it messes up calculations and the different
locale settings should (IMHO) apply only to output function and such.
Thanks,
Jonathan
--
Edit bug report at http://bugs.php.net/?id=17079&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17079&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17079&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17079&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17079&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17079&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17079&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17079&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17079&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17079&r=globals
Thread (18 messages)
- jonathan at tricolon dot com
- mfischer@php.netBug #17079 Updated: setlocale changes the internal representation of floats
- jonathan at tricolon dot comBug #17079 Updated: setlocale changes the internal representation of floats
- jonathan at tricolon dot comBug #17079 Updated: setlocale changes the internal representation of floats
- sniper@php.net#17079 [Ctl]: setlocale changes the internal representation of floats
- andrei@php.net#17079 [Ctl->Ver]: setlocale changes the internal representation of floats
- iliaa@php.net#17079 [Ver->Csd]: setlocale changes the internal representation of floats
- flying at dom dot natm dot ru#17079 [Com]: setlocale changes the internal representation of floats
- jonathan at tricolon dot com#17079 [Csd->Opn]: setlocale changes the internal representation of floats
- iliaa@php.net#17079 [Opn->Bgs]: setlocale changes the internal representation of floats
- jonathan at tricolon dot com#17079 [Bgs->Opn]: setlocale changes the internal representation of floats
- iliaa@php.net#17079 [Opn->Bgs]: setlocale changes the internal representation of floats
- moriyoshi@php.net#17079 [Bgs]: setlocale changes the internal representation of floats
- dMNz at one dot lt#17079 [Com]: setlocale changes the internal representation of floats
- erki at lap dot ttu dot ee#17079 [Com]: setlocale changes the internal representation of floats
- schindler dot andor at empo dot deletethis dot huBug #17079 [Com]: setlocale changes the internal representation of floats
- philonor at googlemail dot comBug #17079 [Com]: setlocale changes the internal representation of floats
- lildurk17079 at gmail dot comBug #17079 [Com]: setlocale changes the internal representation of floats