Commit b823ccb8 authored by duanruiming's avatar duanruiming

[add] 绿波交通比例计算优化

parent bc941dc0
......@@ -2021,8 +2021,8 @@ public class TrendServiceImpl implements TrendService {
private int getRate(int count, int size) {
float temp = count / (float) size * 100;
temp = temp <= 1 ? 1 : temp;
int rate = Math.round(temp);
BigDecimal bigDecimal = new BigDecimal(temp);
int rate = bigDecimal.setScale(0, RoundingMode.HALF_UP).intValue();
return rate;
}
......
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