aboutsummaryrefslogtreecommitdiff
path: root/web/app/store/DistanceUnits.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/store/DistanceUnits.js')
-rw-r--r--web/app/store/DistanceUnits.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/app/store/DistanceUnits.js b/web/app/store/DistanceUnits.js
index 0dcddbea..514a051e 100644
--- a/web/app/store/DistanceUnits.js
+++ b/web/app/store/DistanceUnits.js
@@ -33,13 +33,13 @@ Ext.define('Traccar.store.DistanceUnits', {
factor: 0.000539957
}],
- convertValue: function (value, unit) {
+ convertValue: function (value, unit, back) {
var model;
if (!unit) {
unit = 'km';
}
model = this.findRecord('key', unit);
- return value * model.get('factor');
+ return back ? value / model.get('factor') : value * model.get('factor');
},
formatValue: function (value, unit) {