From 299fe38c668791da896aaa2bb7b13af60dc8e583 Mon Sep 17 00:00:00 2001 From: "chen.s.g" Date: Mon, 14 May 2018 11:52:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=AF=BC=E8=87=B4=E7=9A=84=E6=B5=AE=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=B8=BA=E6=95=B4=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- format.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/format.go b/format.go index cf8f707..a9fff05 100644 --- a/format.go +++ b/format.go @@ -139,6 +139,10 @@ func (f *Format) String(v float64) string { switch f.vType { case TYPE_NUMERIC: + if 0 == f.bts && nil != f.Raw && "general" == f.Raw[0] { + f.bts = -1 + } + ret = strconv.FormatFloat(v, 'f', f.bts, 64) case TYPE_CURRENCY: ret = strconv.FormatFloat(v, 'f', f.bts, 64)