From 3ad3edfadba59e94d95e967e9d5cd28ae671cae4 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 18 Aug 2015 13:47:52 +1200 Subject: Re-factor web interface part --- web/app/store/DistanceUnits.js | 8 +++----- web/app/store/SpeedUnits.js | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'web/app/store') diff --git a/web/app/store/DistanceUnits.js b/web/app/store/DistanceUnits.js index 7f0f93b70..653bf6efb 100644 --- a/web/app/store/DistanceUnits.js +++ b/web/app/store/DistanceUnits.js @@ -25,11 +25,9 @@ Ext.define('Traccar.store.DistanceUnits', { convert: function(value, unit) { switch (unit) { case 'km': - value = value * 0.001; - return Math.round(value * 100) / 100; + return Math.round(value * 0.1) / 100; case 'mi': - value = value * 0.000621371; - return Math.round(value * 100) / 100; + return Math.round(value * 0.0621371) / 100; } return value; }, @@ -40,5 +38,5 @@ Ext.define('Traccar.store.DistanceUnits', { } else { return ''; } - }, + } }); diff --git a/web/app/store/SpeedUnits.js b/web/app/store/SpeedUnits.js index 934d03717..15c52625f 100644 --- a/web/app/store/SpeedUnits.js +++ b/web/app/store/SpeedUnits.js @@ -25,11 +25,9 @@ Ext.define('Traccar.store.SpeedUnits', { convert: function(value, unit) { switch (unit) { case 'kmh': - value = value * 1.852; - return Math.round(value * 10) / 10; + return Math.round(value * 1.852 * 10) / 10; case 'mph': - value = value * 1.15078; - return Math.round(value * 10) / 10; + return Math.round(value * 1.15078 * 10) / 10; } return value; }, -- cgit v1.2.3