21
0

Merge branch 'master' into master

This commit is contained in:
Lucas Liu 2020-04-26 20:43:28 +08:00 committed by GitHub
commit b72264b294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

7
col.go
View File

@ -8,7 +8,7 @@ import (
"time" "time"
"github.com/extrame/goyymmdd" yymmdd "github.com/extrame/goyymmdd"
) )
//content type //content type
@ -63,7 +63,6 @@ func (xf *XfRk) String(wb *WorkBook) string {
f = float64(i) f = float64(i)
} }
t := timeFromExcelTime(f, wb.dateMode == 1) t := timeFromExcelTime(f, wb.dateMode == 1)
return yymmdd.Format(t, formatter.str) return yymmdd.Format(t, formatter.str)
} }
} }
@ -162,6 +161,10 @@ type NumberCol struct {
} }
func (c *NumberCol) String(wb *WorkBook) []string { func (c *NumberCol) String(wb *WorkBook) []string {
if fNo := wb.Xfs[c.Index].formatNo(); fNo != 0 {
t := timeFromExcelTime(c.Float, wb.dateMode == 1)
return []string{yymmdd.Format(t, wb.Formats[fNo].str)}
}
return []string{strconv.FormatFloat(c.Float, 'f', -1, 64)} return []string{strconv.FormatFloat(c.Float, 'f', -1, 64)}
} }