From 1c64c63ab6995f8523fb83e4dcee7b07cfdbc683 Mon Sep 17 00:00:00 2001 From: "chen.s.g" Date: Wed, 18 Apr 2018 23:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9B=E8=88=8D=E4=BA=94?= =?UTF-8?q?=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- format.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/format.go b/format.go index 8df7634..cf8f707 100644 --- a/format.go +++ b/format.go @@ -139,17 +139,9 @@ func (f *Format) String(v float64) string { switch f.vType { case TYPE_NUMERIC: - if 0 == f.bts { - ret = strconv.FormatInt(int64(v), 10) - } else { - ret = strconv.FormatFloat(v, 'f', f.bts, 64) - } + ret = strconv.FormatFloat(v, 'f', f.bts, 64) case TYPE_CURRENCY: - if 0 == f.bts { - ret = strconv.FormatInt(int64(v), 10) - } else { - ret = strconv.FormatFloat(v, 'f', f.bts, 64) - } + ret = strconv.FormatFloat(v, 'f', f.bts, 64) case TYPE_PERCENTAGE: if 0 == f.bts { ret = strconv.FormatInt(int64(v)*100, 10) + "%"