It sure seems so:
The php:
var_dump(array('mynumber'=>42.2));
var_dump(json_encode(array('mynumber'=>42.2)));
The result:
array(1) {
["mynumber"]=>
float(42,2)
}
string(17) "{"mynumber":42,2}"
Notice the 42,2.
‘42,2’ or “42.2” or 42.2 would have all been fine, but 42,2 obviously invalidates your json object.
The problem seems to arise from my ‘nl’ internationalization setting in php. I’m guessing the same problem will occur with any language which uses the comma for decimal separations.
Currently I am solving this problem by typecasting my number to a string, but there has to be a better approach.
Author
Thierry Schellenbach