diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-20 16:38:20 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-20 16:38:20 +1200 |
commit | 33cf23b79f25c1431c23e97b07d03e75f61131b2 (patch) | |
tree | 92dd693e184009f5219669de6e66496459b393fd /web/app/view/state/StateController.js | |
parent | 9e0c0838b0f0c7c3886a5745716f18f943024abb (diff) | |
download | trackermap-server-33cf23b79f25c1431c23e97b07d03e75f61131b2.tar.gz trackermap-server-33cf23b79f25c1431c23e97b07d03e75f61131b2.tar.bz2 trackermap-server-33cf23b79f25c1431c23e97b07d03e75f61131b2.zip |
Implement number values rounding
Diffstat (limited to 'web/app/view/state/StateController.js')
-rw-r--r-- | web/app/view/state/StateController.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js index 58bc5c55c..73dc28b50 100644 --- a/web/app/view/state/StateController.js +++ b/web/app/view/state/StateController.js @@ -73,6 +73,14 @@ Ext.define('Traccar.view.state.StateController', { } }, + formatValue: function(value) { + if (typeof(id) === 'number') { + return +value.toFixed(2); + } else { + return value; + } + }, + updatePosition: function(position) { var other; @@ -93,7 +101,7 @@ Ext.define('Traccar.view.state.StateController', { store.add(Ext.create('Traccar.model.Parameter', { priority: this.keys[key].priority, name: this.keys[key].name, - value: value + value: this.formatValue(value) })); } } @@ -119,7 +127,7 @@ Ext.define('Traccar.view.state.StateController', { name: key.replace(/^./, function (match) { return match.toUpperCase(); }), - value: value + value: this.formatValue(value) })); } } |