From 45a1f08a2ad12ec613fd435ba5efcb830e617a71 Mon Sep 17 00:00:00 2001 From: Dokiy Date: Wed, 1 Dec 2021 19:11:51 +0800 Subject: Fix call getNumFmtID with builtInNumFmt return -1 --- styles.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'styles.go') diff --git a/styles.go b/styles.go index 7f76377..b5df352 100644 --- a/styles.go +++ b/styles.go @@ -2229,12 +2229,12 @@ func (f *File) newFont(style *Style) *xlsxFont { // If given number format code is not exist, will return -1. func getNumFmtID(styleSheet *xlsxStyleSheet, style *Style) (numFmtID int) { numFmtID = -1 - if styleSheet.NumFmts == nil { - return - } if _, ok := builtInNumFmt[style.NumFmt]; ok { return style.NumFmt } + if styleSheet.NumFmts == nil { + return + } if fmtCode, ok := currencyNumFmt[style.NumFmt]; ok { for _, numFmt := range styleSheet.NumFmts.NumFmt { if numFmt.FormatCode == fmtCode { -- cgit v1.2.1