This is because 19.99 is impossible to imagine for sure.
System.out.println(new BigDecimal(19.99));
prints the value that it actually represents, which is the closest to 19.99 that it can represent.
19.989999999999998436805981327779591083526611328125
and 19.99 * 100 is
System.out.println(new BigDecimal(19.99 * 100));
which the
1998.999999999999772626324556767940521240234375
The problem is that you have a presentation error in 19.99 that still exists when multiplied by 100, you get a number that is a little too small.
if you multiply by 100 and round up , which means (int) , you should expect to get 1998.
Alternative is
System.out.println(Math.round(19.99 * 100));
source share