From f4e2c3fa580fab5fb7d9377e17827e0db3ed32b9 Mon Sep 17 00:00:00 2001 From: yezi Date: Fri, 12 Aug 2016 11:17:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B5=AE=E7=82=B9=E6=95=B0=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- col.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/col.go b/col.go index 4aced95..1d05051 100644 --- a/col.go +++ b/col.go @@ -91,7 +91,7 @@ func (rk RK) number() (intNum int64, floatNum float64, isFloat bool) { func (rk RK) String() string { i, f, isFloat := rk.number() if isFloat { - return fmt.Sprintf("%.1f", f) + return strconv.FormatFloat(f, 'f', -1, 64) } return strconv.FormatInt(i, 10) } From 3f54900d96027c385808d1f06412e5a0ac7583a3 Mon Sep 17 00:00:00 2001 From: yezi Date: Fri, 12 Aug 2016 11:31:13 +0800 Subject: [PATCH 2/2] float format --- col.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/col.go b/col.go index 1d05051..826c540 100644 --- a/col.go +++ b/col.go @@ -146,7 +146,7 @@ type NumberCol struct { } func (c *NumberCol) String(wb *WorkBook) []string { - return []string{fmt.Sprintf("%f", c.Float)} + return []string{strconv.FormatFloat(c.Float, 'f', -1, 64)} } type FormulaCol struct {