Commit 73610f59 by Tuomas Riihimäki

sonarqube complains about this. Causes potential rounding error while double is... well double

1 parent 83895c56
...@@ -80,7 +80,7 @@ public class CheckoutFiBeanTest { ...@@ -80,7 +80,7 @@ public class CheckoutFiBeanTest {
bill.setSentDateTime(d); bill.setSentDateTime(d);
Product prod = new Product(); Product prod = new Product();
prod.setName("Hurr"); prod.setName("Hurr");
prod.setPrice(new BigDecimal(111.11).setScale(4, RoundingMode.HALF_UP)); prod.setPrice(BigDecimal.valueOf(111.11).setScale(4, RoundingMode.HALF_UP));
bill.getBillLines().add(new BillLine(bill, prod, new BigDecimal(5))); bill.getBillLines().add(new BillLine(bill, prod, new BigDecimal(5)));
final String priceInCents = Integer.valueOf(bill.totalPrice().multiply(TO_CENTS).intValue()).toString(); final String priceInCents = Integer.valueOf(bill.totalPrice().multiply(TO_CENTS).intValue()).toString();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!