aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/DistanceHandler.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-08-14 17:51:48 +0500
committerAbyss777 <abyss@fox5.ru>2016-08-14 17:51:48 +0500
commit6c8609aa3151246ab171995ef08c161e5d3b8242 (patch)
tree5b95dde870f25aa51c69c48a2f646f2d52ba5475 /src/org/traccar/DistanceHandler.java
parentfec39779b9d84290fc8bcdc3581347d7082103f5 (diff)
downloadtrackermap-server-6c8609aa3151246ab171995ef08c161e5d3b8242.tar.gz
trackermap-server-6c8609aa3151246ab171995ef08c161e5d3b8242.tar.bz2
trackermap-server-6c8609aa3151246ab171995ef08c161e5d3b8242.zip
- Added rounding for some values
- Some changes in casting objects - Renamed General to Summary
Diffstat (limited to 'src/org/traccar/DistanceHandler.java')
-rw-r--r--src/org/traccar/DistanceHandler.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/org/traccar/DistanceHandler.java b/src/org/traccar/DistanceHandler.java
index 99b240150..7537e2867 100644
--- a/src/org/traccar/DistanceHandler.java
+++ b/src/org/traccar/DistanceHandler.java
@@ -55,8 +55,7 @@ public class DistanceHandler extends BaseDataHandler {
if (!position.getAttributes().containsKey(Position.KEY_DISTANCE)) {
position.set(Position.KEY_DISTANCE, distance);
}
- totalDistance += distance;
- totalDistance = BigDecimal.valueOf(totalDistance).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
+ totalDistance = BigDecimal.valueOf(totalDistance + distance).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
position.set(Position.KEY_TOTAL_DISTANCE, totalDistance);
return position;