PUBLIC   marks

ON THIS LINK

PHP Bugs: #17079: setlocale changes the internal representation of floats

by night.kame 2 comments

The system uses Oracle for persistence, where the decimal separator is a comma, as is a custom in that country. So numbers came in from Oracle, and then PHP was unable to process them correctly. For example, if a client had a debt of 25,12€, and the client paid 5€, then the comparison ($paid_amount > $debt) said incorrectly that the paid amount was more than the debt. Result: hundreds of wasted man-hours. In the end we recompiled PHP without that "fix".

Oui, chez Zend aussi on aime faire de la grosse daube.

Comments

PHP4 ? 2002-2004 ?

znarf said at 22:24 the 08/09/2008

Bug déclaré en PHP4.... mais toujours présent en PHP5. J'ai une base Oracle, des NUMBER(5,2) en base, un setlocale en 'fr', et qu'est-ce-que PHP me remonte de la base ? '2,3' en print_r, direct depuis le résultat de la requête. Merci PHP.

night.kame said at 23:00 the 08/09/2008


PUBLIC TAGS
on this link

i18n   kludge   php  

BY

night.kame
the 08/09/2008 at 22:16