I get latitude and longitude values as geocoder results by using codes I got from http://www.phpmoot.com/php-get-latitudelongitude-from-an-address-with-google-map/. What I want is setting the results to have just two digits behind the “.”. For example 137.3463566 to be 137.34. Is there any way to do this?
Share
Same as this answer. You cannot control what Google sends you, but you can discard what you don’t need.
you can use toFixed(), as in
and if you want to round it on the PHP side: