Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 362F1E63F for ; Wed, 6 Mar 2013 03:14:22 +0000 (UTC) Received: (qmail 64471 invoked by uid 500); 6 Mar 2013 03:14:18 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 61896 invoked by uid 500); 6 Mar 2013 03:14:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 61860 invoked by uid 99); 6 Mar 2013 03:14:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Mar 2013 03:14:13 +0000 Date: Wed, 6 Mar 2013 03:14:13 +0000 (UTC) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LANG-843) Providing new class BigDecimalUtils MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated LANG-843: ------------------------------- Fix Version/s: (was: 3.1) Affects Version/s: 3.1 > Providing new class BigDecimalUtils > ----------------------------------- > > Key: LANG-843 > URL: https://issues.apache.org/jira/browse/LANG-843 > Project: Commons Lang > Issue Type: Improvement > Components: lang.* > Affects Versions: 3.1 > Reporter: Premysl Maly > Priority: Minor > Labels: patch > Attachments: equalsUtils.patch > > Original Estimate: 0h > Remaining Estimate: 0h > > Creating Utils class BigDecimalUtils and offering a new implementation of method equals() in ObjectUtils. > Quoting the javaDoc from BigDecimalUtils: > Provides some extra functionality over the BigDecimal class type Comparing two different BigDecimals may be tricky, because yet the value is same, the format may differ and then the equals method implemented on BigDecimal does not return expected results. > BigDecimal first = new BigDecimal("0.10"); > BigDecimal second = new BigDecimal("0.100"); > > first.equals(second); will return false, because those two numbers are not using the same format, even though the values are both "0.1". > Usage examples: > Compare a number to 1: if(BigDecimalUtils.equals(someNumber, BigDecimal.ONE)) > compare two numbers whether they are the same value or both null: if(BigDecimalUtils.equals(someNumber, anotherNumber, NullsEquality.EQUALS)) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira