Skip to content

Commit

Permalink
fix: indexed numbers should be rounded to specified number of decimal…
Browse files Browse the repository at this point in the history
… places

(cherry picked from commit e253ad9)
  • Loading branch information
novoj committed Nov 1, 2024
1 parent 954162a commit 2ec9917
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void shouldConvertBigDecimalToInt() {
assertEquals(11020, NumberUtils.convertToInt(new BigDecimal("110.2"), 2));
assertEquals(11020, NumberUtils.convertToInt(new BigDecimal("110.20"), 2));
assertEquals(11020, NumberUtils.convertToInt(new BigDecimal("110.2000"), 2));
assertThrows(IllegalArgumentException.class, () -> NumberUtils.convertToInt(new BigDecimal("110.202"), 2));
assertThrows(ArithmeticException.class, () -> NumberUtils.convertToInt(new BigDecimal("21474836471"), 2));
}

@Test
Expand Down

0 comments on commit 2ec9917

Please sign in to comment.