aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-08 19:20:09 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-03-08 19:20:09 +1300
commit2ac31b5ba9de43474aca125260d143283afa9e91 (patch)
treeaed993545698ae2e68988e95abb74fe60a1c3ffb /src/org/traccar/reports
parente3a3f06cc07bc5d75d3d670e045abb5d6c91fcad (diff)
downloadtrackermap-server-2ac31b5ba9de43474aca125260d143283afa9e91.tar.gz
trackermap-server-2ac31b5ba9de43474aca125260d143283afa9e91.tar.bz2
trackermap-server-2ac31b5ba9de43474aca125260d143283afa9e91.zip
Minor formatting fixes
Diffstat (limited to 'src/org/traccar/reports')
-rw-r--r--src/org/traccar/reports/ReportUtils.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index 9541e1027..1402e10d4 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -61,10 +61,8 @@ public final class ReportUtils {
public static double calculateDistance(Position firstPosition, Position lastPosition, boolean useOdometer) {
double distance = 0.0;
- double firstOdometer = 0.0;
- double lastOdometer = 0.0;
- firstOdometer = firstPosition.getDouble(Position.KEY_ODOMETER);
- lastOdometer = lastPosition.getDouble(Position.KEY_ODOMETER);
+ double firstOdometer = firstPosition.getDouble(Position.KEY_ODOMETER);
+ double lastOdometer = lastPosition.getDouble(Position.KEY_ODOMETER);
if (useOdometer && (firstOdometer != 0.0 || lastOdometer != 0.0)) {
distance = lastOdometer - firstOdometer;
@@ -85,10 +83,10 @@ public final class ReportUtils {
case "meitrack":
case "galileo":
case "noran":
- BigDecimal v = new BigDecimal(firstPosition.getAttributes()
- .get(Position.KEY_FUEL_LEVEL).toString());
- v = v.subtract(new BigDecimal(lastPosition.getAttributes()
- .get(Position.KEY_FUEL_LEVEL).toString()));
+ BigDecimal v = new BigDecimal(
+ firstPosition.getAttributes().get(Position.KEY_FUEL_LEVEL).toString());
+ v = v.subtract(new BigDecimal(
+ lastPosition.getAttributes().get(Position.KEY_FUEL_LEVEL).toString()));
return v.setScale(2, RoundingMode.HALF_EVEN).toString() + " %";
default:
break;