Skip to content

Commit

Permalink
Set the BCMth scale to 24 to maintain precision in arithmetic that us…
Browse files Browse the repository at this point in the history
…es a lot of decimal places (ie: latitude/longitude).
  • Loading branch information
mstenta committed Nov 29, 2015
1 parent 918585d commit 7e1c919
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion geoPHP.inc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ class geoPHP
}

static function bcmathInstalled() {
return extension_loaded('bcmath');
if (extension_loaded('bcmath')) {
// Set the BCMath scale to 24 to maintain precision in arithmetic that
// uses a lot of decimal places (ie: latitude/longitude).
bcscale(24);
return TRUE;
}
return FALSE;
}

static function geosInstalled($force = NULL) {
Expand Down

0 comments on commit 7e1c919

Please sign in to comment.