How can I change a decimal point to decimal comma by setting it in php.ini without any changes in code on my local server running on Windows?
3.14 >> 3,14
I tried to set
intl.default_locale = cs_CZ
without any results.
EDIT: The reason why I'm asking is that if I execute the code on hosting I get numbers with decimal comma, but when I transfer same code to my local server there is a decimal point. Where is the catch?
For example - Linux hosting:
echo 100 / 3; // 33,333333333333
Local server on Windows:
echo 100 / 3; // 33.333333333333
What is the reason?
EDIT 2: If I use
setlocale(LC_NUMERIC, 'cs_CZ');
echo 100 / 3;
I will get the same result 33.333333333333, so the catch must be in configuration files or in Windows itself.
So what I discovered is that only way, how you can do this on Windows is:
setlocale(LC_ALL, 'czech');
Thanks to http://msdn.microsoft.com/en-us/library/39cwe7zf%28v=vs.90%29.aspx
intl.default_locale
sets the locale for intl
functions only, see this comment.
If your code doesn't use an intl
function for the number formatting, there's no way around changing the code. It should be as easy as setting the locale for money / number formatting to Czech.
For money:
setlocale(LC_MONETARY, 'cs_CZ');
For numbers:
setlocale(LC_NUMERIC, 'cs_CZ');