PHP change the decimal separator
问题 In some circumstances PHP is changing the decimal separator after the operation, here is an example: <?php echo $amount; //21.960000 echo $this->obj_vat->vat; //10.00 $amount= $amount + ( $amount * ( $this->obj_vat->vat / 100 ) ); echo $amount; //24,156 ?> Why the decimal separator changes to ','? This is a multilanguage website. In the spanish version the locale is set to spanish (es_ES), and the decimal separator is ','. That's why is changing. A solution is to force the LC_NUMERIC to