Code example for BigDecimal

Methods: compareTo

0
        decreaseCardLimit(card, value);
        return true; 
    } 
 
    public boolean isValueGreaterThanCardLimit(BigDecimal cardLimit, BigDecimal value) {
        return value.compareTo(cardLimit) > 0;
    } 
 
    public void decreaseCardLimit(Card card, BigDecimal value) {
        card.setCardLimit(card.getCardLimit().subtract(value));
        cardDAO.updateCard(card);
    } 
}