commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LANG-521) NumberUtils.isNumber() Should Return True for Valid Number with a Trailing Decimal Place
Date Sun, 09 Aug 2009 02:43:14 GMT

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

Henri Yandell updated LANG-521:
-------------------------------

         Fix Version/s: 3.0
    Remaining Estimate:     (was: 0.5h)
     Original Estimate:     (was: 0.5h)

Fair enough. Adding to 3.0 version. 

Unit tests needed. createNumber also needs to make sure it works.

> NumberUtils.isNumber() Should Return True for Valid Number with a Trailing Decimal Place
> ----------------------------------------------------------------------------------------
>
>                 Key: LANG-521
>                 URL: https://issues.apache.org/jira/browse/LANG-521
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 2.4
>         Environment: Windows XP SP3, Intel CPU
>            Reporter: Chris Rompot
>            Priority: Minor
>             Fix For: 3.0
>
>
> NumberUtils.isNumber() should return true for a valid number ending in a trailing decimal
place; e.g., "2." should be considered a number because new BigDecimal("2.") works fine. 
This could be done by adding the code below after line 1444, which is the if (chars[i] ==
'e' || chars[i] == 'E') block.
> if (chars[i] == '.') {
>     if (hasDecPoint || hasExp) {
>         // two decimal points or dec in exponent   
>         return false;
>     }
>     return foundDigit; // single trailing decimal point after non-exponent is ok
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message