浏览代码

Merge branch 'hotfix/mix_table_calculate' into debug

# Conflicts:
#	controllers/data_manage/excel/excel_info.go
xyxie 5 月之前
父节点
当前提交
4dd151c31f
共有 1 个文件被更改,包括 2 次插入9 次删除
  1. 2 9
      controllers/data_manage/excel/excel_info.go

+ 2 - 9
controllers/data_manage/excel/excel_info.go

@@ -1786,15 +1786,8 @@ func (c *ExcelInfoController) Calculate() {
 		return
 	}
 	//nanCheck := fmt.Sprintf("%0.f", calVal)
-
-	// 计算结果格式化
-	//calFloat, e := calResult.Float64()
-	//if e != nil {
-	//	br.Msg = "计算失败"
-	//	br.ErrMsg = "计算失败, Err: " + e.Error()
-	//	return
-	//}
-	calVal := utils.FormatTableDataShowValue(calFloat)
+	// 转Decimal然后四舍五入
+	calVal, _ := decimal.NewFromFloat(calFloat).Round(4).Float64()
 
 	//calVal := calResult.String()
 	//if err != nil {