From d5474fd5248395a88667d7d1ad0b3b59470e85f9 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Sat, 6 Dec 2014 15:47:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=BE=D1=80=D0=BC=D0=B0=D1=82=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BE=D1=80=D0=B4=D0=B8=D0=BD=D0=B0=D1=82=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B5=20=D1=82?= =?UTF-8?q?=D0=BE=D1=87=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/classes/Coord.php | 5 ++--- ground/views/point.php | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ground/classes/Coord.php b/ground/classes/Coord.php index 7e1f32c..e267470 100644 --- a/ground/classes/Coord.php +++ b/ground/classes/Coord.php @@ -4,12 +4,11 @@ class Coord { static function dergeeToMinute($input) { - if ($input < 0) - $input *= -1; + $input = abs($input); $degree = floor($input); $minute = 60 * ($input - $degree); - return $degree.'°'.$minute.'\''; + return $degree.'°'.substr($minute,0,6).'\''; } } diff --git a/ground/views/point.php b/ground/views/point.php index 4249501..c31b68e 100644 --- a/ground/views/point.php +++ b/ground/views/point.php @@ -5,8 +5,8 @@
Координаты:  - lat > 0 ? 'N' : 'S' ?>lat > 0 ? $point->lat : (-1 * $point->lat) ?>° - lng > 0 ? 'E' : 'W' ?>lng > 0 ? $point->lng : (-1 * $point->lng) ?>° + lat > 0 ? 'N' : 'S' ?>lat),5,'.','') ?>° + lng > 0 ? 'E' : 'W' ?>lng),5,'.','') ?>°   /