Browse Source

Sometimes number formats get defined in the gaps; don't try and be clever

Brian Smith 11 years ago
parent
commit
94c7505565
1 changed files with 4 additions and 3 deletions
  1. 4 3
      xmlStyle.go

+ 4 - 3
xmlStyle.go

@@ -186,9 +186,10 @@ func (styles *xlsxStyleSheet) getNumberFormat(styleIndex int) string {
 	var numberFormat string = ""
 	if styleIndex > -1 && styleIndex <= styles.CellXfs.Count {
 		xf := styles.CellXfs.Xf[styleIndex]
-		if xf.NumFmtId < 164 {
-			return getBuiltinNumberFormat(xf.NumFmtId)
-		} else if styles.numFmtRefTable != nil {
+		if builtin := getBuiltinNumberFormat(xf.NumFmtId); builtin != "" {
+			return builtin
+		}
+		if styles.numFmtRefTable != nil {
 			numFmt := styles.numFmtRefTable[xf.NumFmtId]
 			numberFormat = numFmt.FormatCode
 		}