PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Reading the setLocal() fn manual and in comments section I found this
be careful with the LC_ALL setting, as it may introduce some unwanted conversions. For example, I used
setlocale (LC_ALL, "Dutch");
to get my weekdays in dutch on the page. From that moment on (as I found out many hours later) my floating point values from MYSQL where interpreted as integers because the Dutch locale wants a comma (,) instead of a point (.) before the decimals. I tried printf, number_format, floatval.... all to no avail. 1.50 was always printed as 1.00
When I set my locale to :
setlocale (LC_TIME, "Dutch");
my weekdays are good now and my floating point values too.
So my question is does it mean that each locale has its way of treating numbers for example here if a "Dutch" locale is used and it rounds the fraction value from 1.50 to 1.00 because Dutch locale wants a comma (,) instead of a point (.) before the decimals?
By the way isnt the locale short code for dutch is nl_BE, nl_NL, nl maybe its the older version where strings were allowed to be passed instead of one of constant values.