I believe your issues is you have a number with a space in the middle. here is how you can remove the space.
$output = "3 128.71535";
$out = preg_replace("/\s/", "", $output);
echo $out; //outputs: 3128.71535
UPDATE
alternatively you can remove anything other than digits and period.
$output = "3 128.71535";
$out = preg_replace("/[^0-9.]/", "", $output);
echo $out; //outputs: 3128.71535