From 0f2c9fe737962436d583d12fcb16beda16f5e0d1 Mon Sep 17 00:00:00 2001 From: John Dupuy Date: Sun, 8 Dec 2024 20:05:34 -0600 Subject: [PATCH] Added tests for proper before-point trailing zero serialization --- decimal_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/decimal_test.go b/decimal_test.go index f76f849..7f1e0bd 100644 --- a/decimal_test.go +++ b/decimal_test.go @@ -3688,6 +3688,10 @@ func TestDecimal_StringWithTrailing(t *testing.T) { {"1.00", "1.00"}, {"0.00", "0.00"}, {"129.123000", "129.123000"}, + {"1.0000E3", "1000.0"}, // 1000 to the nearest tenth + {"1.000E3", "1000"}, // 1000 to the nearest one + {"1.0E3", "1.0E3"}, // 1000 to the nearest hundred + {"1E3", "1E3"}, // 1000 to the nearest thousand } for _, test := range tests {