You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2009/09/06 12:23:58 UTC
[jira] Closed: (OFBIZ-2828) Two bugs in UtilValidate.isDouble() and
UtilValidate.isFloat()
[ https://issues.apache.org/jira/browse/OFBIZ-2828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jacques Le Roux closed OFBIZ-2828.
----------------------------------
Resolution: Fixed
Fix Version/s: SVN trunk
Release Branch 9.04
Assignee: Jacques Le Roux
Thanks Philipp,
Your patch is in trunk at r811793, R9.04 at r811794
> Two bugs in UtilValidate.isDouble() and UtilValidate.isFloat()
> --------------------------------------------------------------
>
> Key: OFBIZ-2828
> URL: https://issues.apache.org/jira/browse/OFBIZ-2828
> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Philipp Hoppen
> Assignee: Jacques Le Roux
> Priority: Minor
> Fix For: Release Branch 9.04, SVN trunk
>
> Attachments: utilvalidate.txt
>
>
> There are two bugs in these two methods: First, the number of digits on the right of the decimal point is wrongly calculated:
> 1.2345 -> String of length 6, decimal point on index 1
> the number of digits on the right of the decimal point is length - decimalPointIndex -1. The -1 was missing.
> The second bug is the following. If a String containing "1.00" is converted to a Double or Float (using Double.parseDouble() or Float.parseFloat()) and then converted back (using Double.toString() or Float.toString()) it will result in "1.0". if minDecimal was set to 2 (and the first bug was fixed) the methods will actually return false.
> I added some Unit-Tests to BaseUnitTests.java to express this in code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.