test: add cases for rounding
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user