test: add cases for rounding

This commit is contained in:
Michael Stapelberg
2023-12-15 17:55:04 +01:00
parent 23c2fd6596
commit 376f1c2508

View File

@@ -42,6 +42,16 @@ func TestAmountValidation(t *testing.T) {
wantAmount: "50.00", wantAmount: "50.00",
}, },
{
amount: "50.339",
wantAmount: "50.34",
},
{
amount: "50.331",
wantAmount: "50.33",
},
{ {
amount: "50.-", amount: "50.-",
wantAmount: "0.00", // result of invalid input wantAmount: "0.00", // result of invalid input