20
0

Update String method to return a floatvalue point cast to string instead of datetime value.

This commit is contained in:
Paul Belitz 2021-12-16 13:35:03 -08:00
parent 4a6cf26307
commit 6b85cf262c
2 changed files with 10 additions and 5 deletions

7
col.go
View File

@ -2,13 +2,11 @@ package xls
import (
"fmt"
yymmdd "github.com/extrame/goyymmdd"
"math"
"strconv"
"strings"
"time"
yymmdd "github.com/extrame/goyymmdd"
)
//content type
@ -71,8 +69,7 @@ func (xf *XfRk) String(wb *WorkBook) string {
if !isFloat {
f = float64(i)
}
t := timeFromExcelTime(f, wb.dateMode == 1)
return yymmdd.Format(t, formatter.str)
return strconv.FormatFloat(f, 'f', 6, 64)
}
}
// see http://www.openoffice.org/sc/excelfileformat.pdf Page #174

8
go.mod Normal file
View File

@ -0,0 +1,8 @@
module chromacode.com/xls
go 1.16
require (
github.com/extrame/goyymmdd v0.0.0-20210114090516-7cc815f00d1a // indirect
github.com/extrame/ole2 v0.0.0-20160812065207-d69429661ad7 // indirect
)