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.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/web/app/store/DistanceUnits.js b/web/app/store/DistanceUnits.js
index 514a051e..189f79bd 100644
--- a/web/app/store/DistanceUnits.js
+++ b/web/app/store/DistanceUnits.js
@@ -48,6 +48,15 @@ Ext.define('Traccar.store.DistanceUnits', {
unit = 'km';
}
model = this.findRecord('key', unit);
+ return value.toFixed(2) + ' ' + model.get('name');
+ },
+
+ convertAndFormat: function (value, unit) {
+ var model;
+ if (!unit) {
+ unit = 'km';
+ }
+ model = this.findRecord('key', unit);
return this.convertValue(value, unit).toFixed(2) + ' ' + model.get('name');
}
});