In one of my methods I make the following comparison, as in the example below:
public static void main(String[] args) {
BigDecimal valor = new BigDecimal("100");
exemplo(valor);
}
public static void exemplo(BigDecimal valor) {
if (valor.compareTo(new BigDecimal("50.000")) == 1 || valor.compareTo(new BigDecimal("50.000")) == 0) {
System.out.println("número maior");
}
}
Passing "100" as a parameter, the problem is that the BigDecimal class ends up with a value of "100" greater than the value "50,000", I tried to pass the value as: "50.000.00" to try to solve the problem , but the class does not allow me to do this, any solution?