From bc0c4319245de8e4ff62f005b22fc73350090d9e Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 20 Jun 2017 17:07:37 +0500 Subject: Change type of 'spentFuel' to double --- src/org/traccar/reports/ReportUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/reports/ReportUtils.java') 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) { -- cgit v1.2.3