commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-226) Rounding issue with byteCountToDisplaySize(long size)
Date Sun, 24 Mar 2013 21:35:15 GMT

    [ https://issues.apache.org/jira/browse/IO-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13612259#comment-13612259
] 

Mark commented on IO-226:
-------------------------

Rounding is one issue, but the inconsistent precision is another one. Showing "923 bytes"
and then just "1 KB" is not ok. It should rather say "round to N chars", ie. "1.1 KB".
                
> Rounding issue with byteCountToDisplaySize(long size)
> -----------------------------------------------------
>
>                 Key: IO-226
>                 URL: https://issues.apache.org/jira/browse/IO-226
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>            Reporter: shu kai yuan
>             Fix For: 2.0
>
>         Attachments: roundedByteCountToDisplaySize.patch
>
>
> I do not understand the byteCountToDisplaySize(long size) method which is in  class FileUtils
of the package org.apache.commons.io.
> If  the parameter size is 2047 , the method will return 1 KB.Why it will lose precision.
> I read the code. 
> Maybe it is a bug?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message