Java BigDecimal Compare compare(BigDecimal decimal, Integer i)

Here you can find the source of compare(BigDecimal decimal, Integer i)

Description

compare

License

Open Source License

Declaration

public static Integer compare(BigDecimal decimal, Integer i) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

public class Main {
    public static Integer compare(BigDecimal decimal, Integer i) {
        if (decimal != null && i != null) {
            return decimal.compareTo(new BigDecimal(i));
        }//w  w w . j  ava2 s. co m
        return null;
    }

    public static Integer compare(BigDecimal decimal, Double d) {
        if (decimal != null && d != null) {
            return decimal.compareTo(new BigDecimal(d));
        }
        return null;
    }
}

Related

  1. compare(BigDecimal first, BigDecimal second)
  2. compare(BigDecimal one, BigDecimal other)
  3. compare(BigDecimal v1, BigDecimal v2)
  4. compareBigDecimal(BigDecimal bigDecimal, BigDecimal bigDecimal2, boolean desc)