diff options
author | xuri <xuri.me@gmail.com> | 2021-09-28 22:02:31 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-09-28 22:02:31 +0800 |
commit | 2d8b5b1885b3d5cd14c974df61a3d0d757efd7bd (patch) | |
tree | 855a0c980145b9fbae26a55fe07676b765e1d518 /styles.go | |
parent | 490f3063c2cb35a94d64f6a6859cce7b9dee276d (diff) |
This closes #1027 and closes #1028
* Fix build-in scientific number format failed
* An error will be returned if given an invalid custom number format when creating a new style
Diffstat (limited to 'styles.go')
-rw-r--r-- | styles.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -930,7 +930,7 @@ func formatToE(v string, format string) string { if err != nil { return v } - return fmt.Sprintf("%.e", f) + return fmt.Sprintf("%.2E", f) } // parseTime provides a function to returns a string parsed using time.Time. @@ -1115,6 +1115,9 @@ func parseFormatStyleSet(style interface{}) (*Style, error) { return &fs, ErrFontSize } } + if fs.CustomNumFmt != nil && len(*fs.CustomNumFmt) == 0 { + err = ErrCustomNumFmt + } return &fs, err } |