Skip to content

Commit

Permalink
Fixed precision rounding money upwards sometimes, causing transitions…
Browse files Browse the repository at this point in the history
… to fail (#1624)
  • Loading branch information
OmerBenGera committed Mar 18, 2023
1 parent 900b331 commit 0c01da8
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -13,7 +13,7 @@ public static double round(double value, int places) {
if (places < 0) throw new IllegalArgumentException();

BigDecimal bd = new BigDecimal(Double.toString(value));
bd = bd.setScale(places, RoundingMode.HALF_DOWN);
bd = bd.setScale(places, RoundingMode.FLOOR);
return bd.doubleValue();
}

Expand Down

0 comments on commit 0c01da8

Please sign in to comment.