diff options
Diffstat (limited to 'src/org/traccar/DistanceHandler.java')
-rw-r--r-- | src/org/traccar/DistanceHandler.java | 3 |
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; |