How to extract a number after the decimal point using BigDecimal ?
BigDecimal d = BigDecimal.valueOf(1548.5649);
result : extract only : 5649
Try:
BigDecimal d = BigDecimal.valueOf(1548.5649);
BigDecimal result = d.subtract(d.setScale(0, RoundingMode.FLOOR)).movePointRight(d.scale());
System.out.println(result);
prints:
5649