Code example for BigDecimal

Methods: signum

0
            setNegative(); 
        } 
    } 
 
    public void setToNumberSign(BigDecimal number) {
        positive = number.signum() >= 0;
        setValue(positive);
    } 
 
    public void setPositive() { 
        setText("+");
        setTextColor(positiveColor);
        positive = true;
    } 
 
    public boolean isPositive() { 
        return positive;
    } 
 
    public void setNegative() { 
        setText("−");