Lets look at this
I have float 32 000, 00 and it parse
No you have a string of "32 000, 00"
. So if we look at how PHP does type juggling
http://php.net/manual/en/language.types.type-juggling.php
We see a few examples like this:
$foo = 5 * "10 Little Piggies"; // $foo is integer (50)
So the value of these 2 multiplied is 50
or 5*10
the ten is parsed from "10 Little Piggies"
. PHP will apply the same rules to what you have above which results in 32
. Because it's a string with those spaces
PHP will do it almost exactly the same way as above.
You can easily test this:
echo floatval('32 000, 00');
Output
32
Sandbox
You may have to manually convert that to what it should be. One easy thing to do is just remove the spaces:
echo floatval(str_replace([' ',','], ['','.'], '32 000, 00'));
echo floatval(str_replace([' ',','], ['','.'], '32 290,01'));
If I remember right some countries use the ,
as the .
for decimal seperator. But I had to replace the ,
with .
to get them to work... There may be some edge cases where this won't work, but without a bigger sample of data I can't say for sure.
Where or why those spaces are in there, I have no idea. It would be better to remove them from the XML entirely, but that may not be possible.
Without some actual code in the question, that's the best I can do.
Cheers!