I am trying to create a french version of one of my sites. I set setlocale(LC_ALL, 'fr_FR'); at the top of my page and using strftime , I correctly display dates in french style.
However, I am having some problems with the number. Part of the page uses the data that I get from the web service. I assign a return value to var as follows:
$overallRating = $returnArray['Overall'];
Then I use the following code later to format it to 1 decimal point.
number_format($overallRating,1)
In the English version, the value of totalRating can be 7.5 and returns a value, for example 7.5 (the reason for running it through number_format is if it returns 7 , I want it to display 7.0 )
However, in the French version, if I print the original value of $ totalRating, I get 7,5 , which looks like it translated it into French. That would be nice, but if I run it through number_format , I get an error:
Notice: A non well formed numeric value encountered in /sites/index.php on line 250
Line 250 is the line number_format
I assume that translating to 7,5 will ruin it, but I'm not sure how to solve it ...
Using PHP 5.3 in case something new helps me