diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-06-21 00:16:43 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-21 00:16:43 +1200 |
commit | c79fa263cca2c641775cebb24858f38aa9400a50 (patch) | |
tree | 93d4cd495a2eb8248bd4ca0759ead2c30241d55b /src/org/traccar/reports/ReportUtils.java | |
parent | 87d3a5d2a2782f57c3dfa50de64052697ca9250d (diff) | |
parent | bc0c4319245de8e4ff62f005b22fc73350090d9e (diff) | |
download | trackermap-server-c79fa263cca2c641775cebb24858f38aa9400a50.tar.gz trackermap-server-c79fa263cca2c641775cebb24858f38aa9400a50.tar.bz2 trackermap-server-c79fa263cca2c641775cebb24858f38aa9400a50.zip |
Merge pull request #3272 from Abyss777/spentFuel_type
Change type of 'spentFuel' to double
Diffstat (limited to 'src/org/traccar/reports/ReportUtils.java')
-rw-r--r-- | src/org/traccar/reports/ReportUtils.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java index 705f11429..71c567c29 100644 --- a/src/org/traccar/reports/ReportUtils.java +++ b/src/org/traccar/reports/ReportUtils.java @@ -89,16 +89,16 @@ public final class ReportUtils { return distance; } - public static String calculateFuel(Position firstPosition, Position lastPosition) { + public static double calculateFuel(Position firstPosition, Position lastPosition) { if (firstPosition.getAttributes().get(Position.KEY_FUEL_LEVEL) != null && lastPosition.getAttributes().get(Position.KEY_FUEL_LEVEL) != null) { BigDecimal value = new BigDecimal(firstPosition.getDouble(Position.KEY_FUEL_LEVEL) - lastPosition.getDouble(Position.KEY_FUEL_LEVEL)); - return value.setScale(1, RoundingMode.HALF_EVEN).toString(); + return value.setScale(1, RoundingMode.HALF_EVEN).doubleValue(); } - return null; + return 0; } public static org.jxls.common.Context initializeContext(long userId) { |