summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-03-19 00:05:47 +0800
committerxuri <xuri.me@gmail.com>2022-03-19 00:05:47 +0800
commit94f197c4fe6531f96a42fe4e960c1c921a3ee0e8 (patch)
tree1506b7d9e7584257768843e7723af2208fe6ce20 /lib.go
parent14b461420fc3d3b06b01d7b0584b422b3e1b40fb (diff)
This improved formula calculate precision and added zero placeholder number format support
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib.go b/lib.go
index 5bbbec9..439e50a 100644
--- a/lib.go
+++ b/lib.go
@@ -688,12 +688,15 @@ func isNumeric(s string) (bool, int) {
if i == 0 && v == '-' {
continue
}
- if e && (v == '+' || v == '-') {
+ if e && v == '-' {
+ return true, 0
+ }
+ if e && v == '+' {
p = 15
continue
}
return false, 0
- } else if dot {
+ } else {
p++
}
n = true