From 94f197c4fe6531f96a42fe4e960c1c921a3ee0e8 Mon Sep 17 00:00:00 2001 From: xuri Date: Sat, 19 Mar 2022 00:05:47 +0800 Subject: This improved formula calculate precision and added zero placeholder number format support --- lib.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib.go') 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 -- cgit v1.2.1