From 38c0ef8fa9a4b814403d47135f2eb2732d172b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 9 Mar 2021 11:40:39 +0800 Subject: [PATCH] aa --- business/jxstore/report/report.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index 325f89ae9..b7197acc0 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -8,6 +8,8 @@ import ( "strings" "time" + "github.com/shopspring/decimal" + "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/partner" @@ -466,8 +468,7 @@ func CalculateCoverArea(coordinate []string) (area float64) { sum += (xyList[i+1][0] - xyList[i][0]) * (xyList[i+1][1] + xyList[i+1][1]) } sum += (xyList[0][0] - xyList[len(xyList)-1][0]) * (xyList[0][1] + xyList[len(xyList)-1][1]) - fmt.Println("1111111111111111111111111111111111111111", sum) sum /= float64(2) - fmt.Println("1111111111111111111111111111111111111111", sum) - return math.Round(sum) + area, _ = decimal.NewFromFloat(sum).Round(2).Float64() + return area }