summaryrefslogtreecommitdiff
path: root/numfmt_test.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 /numfmt_test.go
parent14b461420fc3d3b06b01d7b0584b422b3e1b40fb (diff)
This improved formula calculate precision and added zero placeholder number format support
Diffstat (limited to 'numfmt_test.go')
-rw-r--r--numfmt_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/numfmt_test.go b/numfmt_test.go
index 80534e9..7dc3f77 100644
--- a/numfmt_test.go
+++ b/numfmt_test.go
@@ -996,6 +996,14 @@ func TestNumFmt(t *testing.T) {
{"44896.18957170139", "[$-435]mmmmm dd yyyy h:mm AM/PM", "D 01 2022 4:32 AM"},
{"text_", "General", "text_"},
{"text_", "\"=====\"@@@\"--\"@\"----\"", "=====text_text_text_--text_----"},
+ {"0.0450685976001E+21", "0_);[Red]\\(0\\)", "45068597600100000000"},
+ {"8.0450685976001E+21", "0_);[Red]\\(0\\)", "8045068597600100000000"},
+ {"8.0450685976001E-21", "0_);[Red]\\(0\\)", "0"},
+ {"8.04506", "0_);[Red]\\(0\\)", "8"},
+ {"-0.0450685976001E+21", "0_);[Red]\\(0\\)", "(45068597600100000000)"},
+ {"-8.0450685976001E+21", "0_);[Red]\\(0\\)", "(8045068597600100000000)"},
+ {"-8.0450685976001E-21", "0_);[Red]\\(0\\)", "(0)"},
+ {"-8.04506", "0_);[Red]\\(0\\)", "(8)"},
} {
result := format(item[0], item[1])
assert.Equal(t, item[2], result, item)