[jira] [Updated] (OFBIZ-6386) compareBigDecimals in org.ofbiz.minilang.method.conditional.Compare does not compare certain values correctly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-6386) compareBigDecimals in org.ofbiz.minilang.method.conditional.Compare does not compare certain values correctly

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-6386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gareth Carter updated OFBIZ-6386:
---------------------------------
    Attachment: v2.patch
                v1.patch

v1.patch removes the compareBigDecimals code entirely

v2.patch updates the compareBigDecimals method to up the scale so its a smaller patch with minimal code change.

Personally, I would use v1.patch and remove the code. compareBigDecimals calls BigDecimal.compareTo but it modifies the value before calling compareTo

> compareBigDecimals in org.ofbiz.minilang.method.conditional.Compare does not compare certain values correctly
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-6386
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6386
>             Project: OFBiz
>          Issue Type: Bug
>    Affects Versions: Trunk
>            Reporter: Gareth Carter
>            Priority: Minor
>         Attachments: compareBigDecimals.png, v1.patch, v2.patch
>
>
> Moving the conversation from https://issues.apache.org/jira/browse/OFBIZ-6291 to this issue.
> compareBigDecimals scales down and rounds up meaning you lose information and the comparison result is not as expected



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)