summaryrefslogtreecommitdiff
path: root/comma_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'comma_test.go')
-rw-r--r--comma_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/comma_test.go b/comma_test.go
index 89daca5..c37a518 100644
--- a/comma_test.go
+++ b/comma_test.go
@@ -36,6 +36,15 @@ func TestCommas(t *testing.T) {
}.validate(t)
}
+func TestCommafWithDigits(t *testing.T) {
+ testList{
+ {"1.23, 0", CommafWithDigits(1.23, 0), "1"},
+ {"1.23, 1", CommafWithDigits(1.23, 1), "1.2"},
+ {"1.23, 2", CommafWithDigits(1.23, 2), "1.23"},
+ {"1.23, 3", CommafWithDigits(1.23, 3), "1.23"},
+ }.validate(t)
+}
+
func TestCommafs(t *testing.T) {
testList{
{"0", Commaf(0), "0"},