diff options
author | xuri <xuri.me@gmail.com> | 2022-03-19 00:05:47 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-03-19 00:05:47 +0800 |
commit | 94f197c4fe6531f96a42fe4e960c1c921a3ee0e8 (patch) | |
tree | 1506b7d9e7584257768843e7723af2208fe6ce20 /lib.go | |
parent | 14b461420fc3d3b06b01d7b0584b422b3e1b40fb (diff) |
This improved formula calculate precision and added zero placeholder number format support
Diffstat (limited to 'lib.go')
-rw-r--r-- | lib.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |