Java Number Compare compareTo(Object value1, Object value2)

Here you can find the source of compareTo(Object value1, Object value2)

Description

compare To

License

Open Source License

Declaration

public static int compareTo(Object value1, Object value2) 

Method Source Code


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

import java.math.BigDecimal;

public class Main {
    public static int compareTo(Object value1, Object value2) {
        return new BigDecimal(String.valueOf(value1)).compareTo(new BigDecimal(String.valueOf(value2)));
    }/*  ww  w.j  a  v a2s .  c  o m*/
}

Related

  1. compareDoubleAgainstLong(double lhs, long rhs)
  2. compareDoublesWithTolerance(double aa, double bb, double tolerance)
  3. compareStringsAsNumbers(String s1, String s2, String op)
  4. compareTo(double v1, double v2)
  5. compareTo(Object val1, Object val2)
  6. compareTwoObject(Object o1, Object o2)
  7. compareValue(Object left, Object right)
  8. compareValues(String value, String type, Object obj)
  9. getCrosstabRowColumnValue(String groupIdentifier, Map crosstabInfoMap, Object executorUnitId, String financesBankId, String companyNumber, String accountNumber)