mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
airos: fix latitude having an extra - in the middle after the decimal point (#13454)
* fix latitude having an extra - in the middle after the decimal point fix latitude having an extra - in the middle after the decimal point * consolidate * style Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -73,8 +73,10 @@ class Airos extends OS implements
|
||||
{
|
||||
$location = parent::fetchLocation();
|
||||
|
||||
// fix longitude having an extra - in the middle after the decimal point
|
||||
$location->lng = (float) preg_replace('/(-?\d+)\.-?(\d+)/', '$1.$2', $location->getAttributes()['lng']);
|
||||
// fix having an extra - in the middle after the decimal point
|
||||
$regex = '/(-?\d+)\.-?(\d+)/';
|
||||
$location->lng = (float) preg_replace($regex, '$1.$2', $location->getAttributes()['lng']);
|
||||
$location->lat = (float) preg_replace($regex, '$1.$2', $location->getAttributes()['lat']);
|
||||
|
||||
return $location;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user