src/main/java/com/xdavide9/calculatorfx/CalculatorFXController.java
private BigDecimal round(BigDecimal d) {
        if (!d.toString().contains("."))
            throw new IllegalArgumentException();
        int leftDigits = d.toString().substring(0, d.toString().indexOf('.')).length();
        d = d.setScale(maxDigits - leftDigits - 2, RoundingMode.HALF_UP);
        d = stripDecimalTrailingZeros(d);
        return d;
    }
/**
     * Rounds the number depending on the max digits that are possible on the label
     * in order to show the max precision.
     *
     * @throws IllegalArgumentException if it doesn't have a point
     */
Rounds the number depending on the max digits that are possible on the label
in order to show the max precision.

@throws IllegalArgumentException if it doesn't have a point
Rounds the number depending on the max digits that are possible on the label in order to show the max precision . @throws IllegalArgumentException if it doesn ' t have a point
private BigDecimal round(BigDecimal d) {
        if (!d.toString().contains("."))
            throw new IllegalArgumentException();
        int leftDigits = d.toString().substring(0, d.toString().indexOf('.')).length();
        d = d.setScale(maxDigits - leftDigits - 2, RoundingMode.HALF_UP);
        d = stripDecimalTrailingZeros(d);
        return d;
    }
private BigDecimal round ( BigDecimal d ) { if ( ! d . toString ( ) . contains ( "." ) ) throw new IllegalArgumentException ( ) ; int leftDigits = d . toString ( ) . substring ( 0 , d . toString ( ) . indexOf ( '.' ) ) . length ( ) ; d = d . setScale ( maxDigits - leftDigits - 2 , RoundingMode . HALF_UP ) ; d = stripDecimalTrailingZeros ( d ) ; return d ; }
Rounds the number depending on the max digits that are possible on the label
 in order to show the max precision.
Rounds the number depending on the max digits that are possible on the label in order to show the max precision .