title: How to get integer and fraction portions of a BigDecimal in Java
body: <p>For a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html" rel="nofollow noreferrer"><code>BigDecimal</code></a> number such as 42.7, how can I tear this apart to get the integer part (42) and the decimal fractional part (0.7)?</p>
  <p>I would like to retrieve both as <code>BigDecimal</code> objects. But I will take what I can get and make <code>BigDecimal</code> object from them.</p>