Returns the min number in the BigDecimal list. - Java java.math

Java examples for java.math:BigDecimal Calculation

Description

Returns the min number in the BigDecimal list.

Demo Code


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

import java.util.List;
import java.util.TreeSet;

public class Main {


    /**/* w  ww  . j a  v a2 s  .c o  m*/
     * Returns the min number in the numbers list.
     *
     * @param numbers the numbers to calculate the min.
     * @return the min number in the numbers list.
     */
    public static BigDecimal min(List<BigDecimal> numbers) {
        return new TreeSet<BigDecimal>(numbers).first();
    }
}

Related Tutorials