21
0

support date format

This commit is contained in:
Federico Simoncelli 2020-03-27 21:08:35 +01:00
parent 0ecbf4c42c
commit b8b06ac1dd

4
col.go
View File

@ -161,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)}
} }