summaryrefslogtreecommitdiff
path: root/cell.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-10-19 23:55:54 +0800
committerxuri <xuri.me@gmail.com>2020-10-19 23:55:54 +0800
commit4834a058aa3f953a7010704f2358633ae6e1d492 (patch)
tree08fa4cd30047ebee2a6f5e84a0ac8ea2796e27f3 /cell.go
parent520aa679f34bafbc00626151075b0b123eceb516 (diff)
This closes #714 and closes #715, fix wrong worksheet index returned by NewSheet in some case, fix panic on formatted value with no built-in number format ID
Diffstat (limited to 'cell.go')
-rw-r--r--cell.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/cell.go b/cell.go
index 11c6836..bdda48c 100644
--- a/cell.go
+++ b/cell.go
@@ -770,6 +770,9 @@ func (f *File) formattedValue(s int, v string) string {
if ok != nil {
return ok(v, builtInNumFmt[numFmtId])
}
+ if styleSheet == nil || styleSheet.NumFmts == nil {
+ return v
+ }
for _, xlsxFmt := range styleSheet.NumFmts.NumFmt {
if xlsxFmt.NumFmtID == numFmtId {
format := strings.ToLower(xlsxFmt.FormatCode)