You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2016/06/12 11:32:21 UTC
[jira] [Commented] (LANG-1215) NumberUtils.createNumber() method
lost precision sometimes
[ https://issues.apache.org/jira/browse/LANG-1215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15326386#comment-15326386 ]
Pascal Schumacher commented on LANG-1215:
-----------------------------------------
The fix for LANG-1018 also solves this, so this will be fixed in 3.5.
> NumberUtils.createNumber() method lost precision sometimes
> ----------------------------------------------------------
>
> Key: LANG-1215
> URL: https://issues.apache.org/jira/browse/LANG-1215
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.math.*
> Affects Versions: 2.6, 3.4
> Environment: Windows 7,Jdk1.6,Eclipse 3.5
> Reporter: charryong
> Priority: Critical
> Labels: github-import
> Original Estimate: 72h
> Remaining Estimate: 72h
>
> For example:
> System.out.println(NumberUtils.createNumber("193343.82"));
> The result is 193343.81。
> The bug because of code in the class NumberUtils of the org.apache.commons.lang3.math package。
> public static Float createFloat(final String str) {
> if (str == null) {
> return null;
> }
> return Float.valueOf(str);
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)