20
0
This commit is contained in:
Liu Ming 2016-09-30 11:47:04 +08:00
commit 1127e94c69

4
col.go
View File

@ -91,7 +91,7 @@ func (rk RK) number() (intNum int64, floatNum float64, isFloat bool) {
func (rk RK) String() string { func (rk RK) String() string {
i, f, isFloat := rk.number() i, f, isFloat := rk.number()
if isFloat { if isFloat {
return fmt.Sprintf("%.1f", f) return strconv.FormatFloat(f, 'f', -1, 64)
} }
return strconv.FormatInt(i, 10) return strconv.FormatInt(i, 10)
} }
@ -146,7 +146,7 @@ type NumberCol struct {
} }
func (c *NumberCol) String(wb *WorkBook) []string { 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 { type FormulaCol struct {