From 6b85cf262c530c767016b07a25cee83ad02379d8 Mon Sep 17 00:00:00 2001 From: Paul Belitz Date: Thu, 16 Dec 2021 13:35:03 -0800 Subject: [PATCH] Update String method to return a floatvalue point cast to string instead of datetime value. --- col.go | 7 ++----- go.mod | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 go.mod diff --git a/col.go b/col.go index 8636566..aaef2ac 100644 --- a/col.go +++ b/col.go @@ -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 diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..fa74b4a --- /dev/null +++ b/go.mod @@ -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 +)