Commit d71ffd74 authored by lisong's avatar lisong

修改车辆里程计算精度bug

parent e682d724
...@@ -20,6 +20,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -20,6 +20,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -179,7 +180,9 @@ public class WlCarMileageController { ...@@ -179,7 +180,9 @@ public class WlCarMileageController {
// //
// String timeStr = dateFormat.format(totalTime); // String timeStr = dateFormat.format(totalTime);
carTravelDto.setTotalTime(millisToStringShort(totalTime)); carTravelDto.setTotalTime(millisToStringShort(totalTime));
carTravelDto.setTotalTravel(totalTravel); BigDecimal two = BigDecimal.valueOf(totalTravel);
double result = two.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
carTravelDto.setTotalTravel(result);
return carTravelDto; return carTravelDto;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment