aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports/General.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-08-05 11:58:43 +0500
committerAbyss777 <abyss@fox5.ru>2016-08-05 11:58:43 +0500
commit933247b3d2ec24d65203fae39dcafbe2c9afb87e (patch)
tree14e3c104532dc0fa058ed5cf2ef5a4eb99e24660 /src/org/traccar/reports/General.java
parent7c96911d3770eafe4625b27acd732b10d717b9d0 (diff)
downloadtrackermap-server-933247b3d2ec24d65203fae39dcafbe2c9afb87e.tar.gz
trackermap-server-933247b3d2ec24d65203fae39dcafbe2c9afb87e.tar.bz2
trackermap-server-933247b3d2ec24d65203fae39dcafbe2c9afb87e.zip
- Added distance rounding
- Fixed charset
Diffstat (limited to 'src/org/traccar/reports/General.java')
-rw-r--r--src/org/traccar/reports/General.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/org/traccar/reports/General.java b/src/org/traccar/reports/General.java
index bcf2312b2..75194bc13 100644
--- a/src/org/traccar/reports/General.java
+++ b/src/org/traccar/reports/General.java
@@ -1,5 +1,7 @@
package org.traccar.reports;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Date;
@@ -76,6 +78,7 @@ public final class General {
result.setMaxSpeed(position.getSpeed());
}
result.setAverageSpeed(speedSum / positions.size());
+ result.setDistance(new BigDecimal(result.getDistance()).setScale(2, RoundingMode.HALF_UP).doubleValue());
}
return result;
}