Skip to content

Commit

Permalink
Handle number formats out of built-in range exception by returning ra…
Browse files Browse the repository at this point in the history
…w value, relate issue qax-os#50.
  • Loading branch information
xuri committed May 5, 2017
1 parent 8fbab47 commit 66349f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ func (f *File) formattedValue(s int, v string) string {
}
var styleSheet xlsxStyleSheet
xml.Unmarshal([]byte(f.readXML("xl/styles.xml")), &styleSheet)
return builtInNumFmtFunc[styleSheet.CellXfs.Xf[s].NumFmtID](styleSheet.CellXfs.Xf[s].NumFmtID, v)
ok := builtInNumFmtFunc[styleSheet.CellXfs.Xf[s].NumFmtID]
if ok != nil {
return ok(styleSheet.CellXfs.Xf[s].NumFmtID, v)
}
return v
}

// GetCellFormula provides function to get formula from cell by given sheet
Expand Down
Binary file modified test/Workbook1.xlsx
Binary file not shown.

0 comments on commit 66349f8

Please sign in to comment.