Java BigDecimal Compare GreaterThanOrEqual(BigDecimal one, BigDecimal two)

Here you can find the source of GreaterThanOrEqual(BigDecimal one, BigDecimal two)

Description

Greater Than Or Equal

License

Open Source License

Declaration

public static boolean GreaterThanOrEqual(BigDecimal one, BigDecimal two) 

Method Source Code


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

import java.math.BigDecimal;

public class Main {
    public static boolean GreaterThanOrEqual(BigDecimal one, BigDecimal two) {
        if (!Equals(one, two)) {
            return GreaterThan(one, two);
        }//from  w w  w  . j  av  a  2s.c om
        return true;
    }

    /**
     * Returns true if one == two
     * @param one The first number
     * @param two The second number
     * @return True if one == two, false otherwise
     */
    public static boolean Equals(BigDecimal one, BigDecimal two) {
        return (one.compareTo(two) == 0);
    }

    /**
     * Returns true if one > two
     * @param one The first number
     * @param two The second number
     * @return True if one > two, false otherwise
     */
    public static boolean GreaterThan(BigDecimal one, BigDecimal two) {
        return (one.compareTo(two) > 0);
    }
}

Related

  1. compareToOne(BigDecimal x)
  2. compareToZeroOrNull(BigDecimal value)
  3. greaterThan(BigDecimal decimal, double number)
  4. GreaterThan(BigDecimal one, BigDecimal two)
  5. greaterThan(BigDecimal val, double threshold)
  6. greaterThanZero(BigDecimal d)
  7. greaterThanZero(BigDecimal is)
  8. isGreater(BigDecimal a, BigDecimal b)
  9. isGreaterThanOne(@Nonnull final BigDecimal aValue)