diff options
author | xuri <xuri.me@gmail.com> | 2022-08-12 00:32:51 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-08-12 00:32:51 +0800 |
commit | 8152bbb2cec76f074dc18c43f3c66bf8abdf9de0 (patch) | |
tree | 5052a82092f141cda644c83d5e891d2edf769aa8 /numfmt.go | |
parent | ed91cddea59ce15da87ab744ac20b465a36ed5ef (diff) |
This closes #1312, #1313, fix number format issue
- Add supported options in the docs of the functions `SetSheetPrOptions` and `GetSheetPrOptions`
- Add go1.19 unit test settings, and made the test case compatible with go1.19
- Update dependencies module
Diffstat (limited to 'numfmt.go')
-rw-r--r-- | numfmt.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -337,7 +337,7 @@ func (nf *numberFormat) positiveHandler() (result string) { nf.result += token.TValue continue } - if token.TType == nfp.TokenTypeZeroPlaceHolder && token.TValue == "0" { + if token.TType == nfp.TokenTypeZeroPlaceHolder && token.TValue == strings.Repeat("0", len(token.TValue)) { if isNum, precision := isNumeric(nf.value); isNum { if nf.number < 1 { nf.result += "0" @@ -899,7 +899,7 @@ func (nf *numberFormat) negativeHandler() (result string) { nf.result += token.TValue continue } - if token.TType == nfp.TokenTypeZeroPlaceHolder && token.TValue == "0" { + if token.TType == nfp.TokenTypeZeroPlaceHolder && token.TValue == strings.Repeat("0", len(token.TValue)) { if isNum, precision := isNumeric(nf.value); isNum { if math.Abs(nf.number) < 1 { nf.result += "0" |