I have a double, that is being read in by an XML document, with 7 digits after the decimal place.
I want to get it to 4, but nothing seems to be working, number format and round used, My final idea was *1000, format /1000 but its not using the numbers in the decimal place.
echo $lng;
$lng = $lng * 1000;
echo $lng;
$lng = number_format($lng,0);
echo $lng;
$lng = $lng / 1000;
echo $lng;
This gives me the following results:
lng -2.9763323
lng -2000
lng -2,000
lng -0.002
Any help would be welcome