commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Brown (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LANG-1205) NumberUtils.createNumber() behaves inconsistently with NumberUtils.isNumber()
Date Tue, 23 Feb 2016 16:41:18 GMT

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

Daniel Brown updated LANG-1205:
-------------------------------
    Description: 
The {{NumberUtils.createNumber()}} method fails to check for multiple trailing characters,
and as a result, it returns a value even though {{NumberUtils.isNumber()}} indicates that
it should not.  For example:

{code}
boolean isNumber = NumberUtils.isNumber("81.5514DD");   // returns false

Number numValue = NumberUtils.createNumber("81.5514DD");  // returns a Double value, 81.5514
{code}

  was:
The {{Number.createNumber()}} method fails to check for multiple trailing characters, and
as a result, it returns a value even though {{Number.isNumber()}} indicates that it should
not.  For example:

{code}
boolean isNumber = Number.isNumber("81.5514DD");   // returns false

Number numValue = NumberUtils.createNumber("81.5514DD");  // returns a Double value, 81.5514
{code}


> NumberUtils.createNumber() behaves inconsistently with NumberUtils.isNumber()
> -----------------------------------------------------------------------------
>
>                 Key: LANG-1205
>                 URL: https://issues.apache.org/jira/browse/LANG-1205
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.1
>            Reporter: Daniel Brown
>
> The {{NumberUtils.createNumber()}} method fails to check for multiple trailing characters,
and as a result, it returns a value even though {{NumberUtils.isNumber()}} indicates that
it should not.  For example:
> {code}
> boolean isNumber = NumberUtils.isNumber("81.5514DD");   // returns false
> Number numValue = NumberUtils.createNumber("81.5514DD");  // returns a Double value,
81.5514
> {code}



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

Mime
View raw message