From 1f4e9f3813f91e610955404e53f7137c79737d80 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 15 Nov 2018 10:12:02 +0800 Subject: [PATCH] - use math.Round in CaculateSkuVendorPrice --- business/jxutils/jxutils_cms.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/jxutils/jxutils_cms.go b/business/jxutils/jxutils_cms.go index baddaf962..abfdab048 100644 --- a/business/jxutils/jxutils_cms.go +++ b/business/jxutils/jxutils_cms.go @@ -148,7 +148,7 @@ func GetSliceLen(list interface{}) int { } func CaculateSkuVendorPrice(price int, percentage int) int { - return price * percentage / 100 + return int(math.Round(float64(price*percentage) / 100)) } // 生成一个不重复的临时ID