From b84bd1abc06457f6383013b8a600fc8c95eed2ed Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 27 Jan 2021 13:51:47 +0800 Subject: new formula fn: IF, LEN; not equal operator support and faster numeric precision process --- rows.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'rows.go') diff --git a/rows.go b/rows.go index 44c4b64..97cf2f5 100644 --- a/rows.go +++ b/rows.go @@ -20,7 +20,6 @@ import ( "log" "math" "strconv" - "strings" "github.com/mohae/deepcopy" ) @@ -346,12 +345,9 @@ func (c *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) { } return f.formattedValue(c.S, c.V), nil default: - splited := strings.Split(c.V, ".") - if len(splited) == 2 && len(splited[1]) > 15 { - val, err := roundPrecision(c.V) - if err != nil { - return "", err - } + isNum, precision := isNumeric(c.V) + if isNum && precision > 15 { + val, _ := roundPrecision(c.V) if val != c.V { return f.formattedValue(c.S, val), nil } -- cgit v1.2.1