流量统计数值保留两位小数

This commit is contained in:
zhanghongqing
2018-12-12 15:33:27 +08:00
parent a3f2943e5c
commit f5b0a0d4d0
4 changed files with 11 additions and 9 deletions

View File

@@ -270,12 +270,12 @@ public class TrafficStatisticsInfoController extends BaseController {
Long totalPackets=0l;
Double totalGByte=0d;
DecimalFormat lf = new DecimalFormat("0");
DecimalFormat df = new DecimalFormat("0.00000000");
DecimalFormat df = new DecimalFormat("0.00");
List<CodeResult> appCodeList = CodeDicUtils.getCodeList("appCode");
if(!StringUtil.isEmpty(list)){
for (Object object : list) {
Map m=(Map) object;
Double value1 = Double.parseDouble(m.get("protocolType").toString());
Double value1 = Double.parseDouble(m.get("protoType").toString());
totalGByte+=Double.parseDouble(m.get("GByte").toString());
// String linkNum = df.format(m.get("linkNum"));
m.put("GByte", df.format(m.get("GByte")));
@@ -338,7 +338,7 @@ public class TrafficStatisticsInfoController extends BaseController {
Long totalPackets=0l;
Double totalGByte=0d;
DecimalFormat lf = new DecimalFormat("0");
DecimalFormat df = new DecimalFormat("0.00000000");
DecimalFormat df = new DecimalFormat("0.00");
if(!StringUtil.isEmpty(list)){
for (Object object : list) {
Map m=(Map) object;