summaryrefslogtreecommitdiff
path: root/numfmt.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-08-12 00:32:51 +0800
committerxuri <xuri.me@gmail.com>2022-08-12 00:32:51 +0800
commit8152bbb2cec76f074dc18c43f3c66bf8abdf9de0 (patch)
tree5052a82092f141cda644c83d5e891d2edf769aa8 /numfmt.go
parented91cddea59ce15da87ab744ac20b465a36ed5ef (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.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/numfmt.go b/numfmt.go
index 6b4fc65..56f354f 100644
--- a/numfmt.go
+++ b/numfmt.go
@@ -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"