src/main/java/com/xdavide9/calculatorfx/CalculatorFXController.java
@FXML
    protected void onMemoryOperationPressed(ActionEvent e) {
        id = updateId(e);
        log.info("Pressed: {}", id);

        onLabel = label.getText();
        if (status(onLabel) == -1) return;

        if (onLabel.equals(""))
            return;

        if (!hasCount) {
            count = new BigDecimal(label.getText());
            hasCount = true;
        } else {
            temp = new BigDecimal(label.getText());
            hasTemp = true;
        }

        builder = new StringBuilder();

        if (hasTemp && operation != 0) {
            performOperation();
            hasTemp = false;
            temp = new BigDecimal("0");
        } else {
            log.info("No temp to perform the operation with in memory");
        }

        onLabel = count.toString();

        if (hasTooManyDigits(onLabel.length())) {
            log.error("Result had too many digits");
            displayErr();
            return;
        }

        label.setText(onLabel);

        switch (id) {
            case "plusButton" -> operation = '+';
            case "minusButton" -> operation = '-';
            case "timesButton" -> operation = '*';
            case "divideButton" -> operation = '/';
            case "toThePowerOfNButton" -> operation = 'p';
            case "radicalNButton" -> operation = 'r';
            case "logBaseNButton" -> operation = 'l';
        }
    }
/**
     * Performs an operation using memory:
     * stores the number in the label either in count or temp,
     * performs an operation if it was stored in memory and
     * stores the operation to be performed next.
     */
Performs an operation using memory:
stores the number in the label either in count or temp,
performs an operation if it was stored in memory and
stores the operation to be performed next.
Performs an operation using memory : stores the number in the label either in count or temp performs an operation if it was stored in memory and stores the operation to be performed next .
@FXML
    protected void onMemoryOperationPressed(ActionEvent e) {
        id = updateId(e);
        log.info("Pressed: {}", id);
        onLabel = label.getText();
        if (status(onLabel) == -1) return;
        if (onLabel.equals(""))
            return;
        if (!hasCount) {
            count = new BigDecimal(label.getText());
            hasCount = true;
        } else {
            temp = new BigDecimal(label.getText());
            hasTemp = true;
        }
        builder = new StringBuilder();
        if (hasTemp && operation != 0) {
            performOperation();
            hasTemp = false;
            temp = new BigDecimal("0");
        } else {
            log.info("No temp to perform the operation with in memory");
        }
        onLabel = count.toString();
        if (hasTooManyDigits(onLabel.length())) {
            log.error("Result had too many digits");
            displayErr();
            return;
        }
        label.setText(onLabel);
        switch (id) {
            case "plusButton" -> operation = '+';
            case "minusButton" -> operation = '-';
            case "timesButton" -> operation = '*';
            case "divideButton" -> operation = '/';
            case "toThePowerOfNButton" -> operation = 'p';
            case "radicalNButton" -> operation = 'r';
            case "logBaseNButton" -> operation = 'l';
        }
    }
@ FXML protected void onMemoryOperationPressed ( ActionEvent e ) { id = updateId ( e ) ; log . info ( "Pressed: {}" , id ) ; onLabel = label . getText ( ) ; if ( status ( onLabel ) == - 1 ) return ; if ( onLabel . equals ( "" ) ) return ; if ( ! hasCount ) { count = new BigDecimal ( label . getText ( ) ) ; hasCount = true ; } else { temp = new BigDecimal ( label . getText ( ) ) ; hasTemp = true ; } builder = new StringBuilder ( ) ; if ( hasTemp && operation != 0 ) { performOperation ( ) ; hasTemp = false ; temp = new BigDecimal ( "0" ) ; } else { log . info ( "No temp to perform the operation with in memory" ) ; } onLabel = count . toString ( ) ; if ( hasTooManyDigits ( onLabel . length ( ) ) ) { log . error ( "Result had too many digits" ) ; displayErr ( ) ; return ; } label . setText ( onLabel ) ; switch ( id ) { case "plusButton" -> operation = '+' ; case "minusButton" -> operation = '-' ; case "timesButton" -> operation = '*' ; case "divideButton" -> operation = '/' ; case "toThePowerOfNButton" -> operation = 'p' ; case "radicalNButton" -> operation = 'r' ; case "logBaseNButton" -> operation = 'l' ; } }
Performs an operation using memory:
 stores the number in the label either in count or temp,
 performs an operation if it was stored in memory and
 stores the operation to be performed next.
Performs an operation using memory : stores the number in the label either in count or temp performs an operation if it was stored in memory and stores the operation to be performed next .