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 --- cell.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cell.go') diff --git a/cell.go b/cell.go index 41a9517..e1c7803 100644 --- a/cell.go +++ b/cell.go @@ -354,7 +354,7 @@ func (f *File) SetCellStr(sheet, axis, value string) error { // table. func (f *File) setCellString(value string) (t string, v string) { if len(value) > TotalCellChars { - value = value[0:TotalCellChars] + value = value[:TotalCellChars] } t = "s" v = strconv.Itoa(f.setSharedString(value)) @@ -381,7 +381,7 @@ func (f *File) setSharedString(val string) int { // setCellStr provides a function to set string type to cell. func setCellStr(value string) (t string, v string, ns xml.Attr) { if len(value) > TotalCellChars { - value = value[0:TotalCellChars] + value = value[:TotalCellChars] } if len(value) > 0 { prefix, suffix := value[0], value[len(value)-1] -- cgit v1.2.1