Question

since few days, I have issues with a website i'm working on. This website is made with Prestashop and when i test it on my local server (i'm using WAMP) all is ok, but when i upload the site on my web server, some request send prestashop to get decimals numbers return me numbers like this XX,XX (and on Wamp, i get XX.XX)

the problem is this comma cause many problems to set prices or tax

did anyone already seen this kind of issues ?

Thanks (and sorry for my bad english)

Was it helpful?

Solution

PHP probably uses the system default locale. Use the following to make sure you use a specific locale:

setlocale(LC_ALL, 'nl_NL'); // for Dutch

see: http://www.php.net/manual/en/function.setlocale.php

Locale determines how date, currencies and numeric values are formatted. You can change the locale for specific PHP functions only (such as currency formatting).

Setting locale for currency only:

setlocale(LC_MONETARY, 'en_EN'); // for English

Setting locale for numeric formatting only:

setlocale(LC_NUMERIC, 'en_EN'); // for English

See above link for more detailed information on that topic.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top