Skip to content

Commit

Permalink
Note problem with rounding inaccuracy to fix later
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Nov 13, 2018
1 parent 26ea6d0 commit 0be552d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions calculator/calculator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ func TestCouponWithVATWhenPRiceIncludeTaxesWithQuantity(t *testing.T) {
params := PriceParameters{"USA", "USD", coupon, []Item{&TestItem{quantity: 2, price: 100, itemType: "test", vat: 9}}}
price := CalculatePrice(settings, nil, params, testLogger)

// todo: This result is wrong because a rounding inaccuracy is quantified
// Therefore the tax amount is not 9% of the net total
// Correct net total: 165
// Correct tax amount: 15
validatePrice(t, price, Price{
Subtotal: 184,
Discount: 20,
Expand Down

0 comments on commit 0be552d

Please sign in to comment.