From bc3c7d51a2efe5f0ad85667a8f9636f13941d577 Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 17 Nov 2021 00:25:36 +0800 Subject: ref #65: new formula function PRICE - fix COUPPCD result accuracy issue - update close spreadsheet example in documentation and README --- sheet.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sheet.go') diff --git a/sheet.go b/sheet.go index 5738ced..1aa378b 100644 --- a/sheet.go +++ b/sheet.go @@ -234,7 +234,7 @@ func trimCell(column []xlsxC) []xlsxC { i++ } } - return col[0:i] + return col[:i] } // setContentTypes provides a function to read and update property of contents @@ -452,12 +452,14 @@ func (f *File) GetSheetIndex(name string) int { // if err != nil { // return // } +// defer func() { +// if err := f.Close(); err != nil { +// fmt.Println(err) +// } +// }() // for index, name := range f.GetSheetMap() { // fmt.Println(index, name) // } -// if err = f.Close(); err != nil { -// fmt.Println(err) -// } // func (f *File) GetSheetMap() map[int]string { wb := f.workbookReader() -- cgit v1.2.1