Returns the absolute value of the BigDecimal value, handles null. - Java java.math

Java examples for java.math:BigDecimal

Description

Returns the absolute value of the BigDecimal value, handles null.

Demo Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {


    /**//from   w  w  w  .  j av a2s  .  c  om
     * Returns the ABS of the value, handles null.
     */
    public static BigDecimal abs(final BigDecimal value) {
        return value != null ? value.abs() : null;
    }
}

Related Tutorials