commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <>
Subject [jira] [Commented] (IO-373) FileUtils.byteCountToDisplaySize improvement/rounding issues
Date Mon, 24 Jun 2013 16:54:20 GMT


Benedikt Ritter commented on IO-373:

How about adding something like [java.util.concurrent.TimeUnit|]?
It could look something like this:


This would translate 1024 bytes to kilobytes. We would also need a static method in {{FileSize}}
that can figure out which unit best matches:


It makes sense to have a method with a default precision and one where you can pass the desired
as parameter.
The FileSize class could also help when translating between sizes:

FileSize.BYTES.toMegaBytes(1024 * 3L);

Another thing I've thought about is to distinguish between [metric prefixes|]
and [binary prefixes|] but I'm not sure if there
are use cases for translating file sizes with metric factors.

> FileUtils.byteCountToDisplaySize improvement/rounding issues
> ------------------------------------------------------------
>                 Key: IO-373
>                 URL:
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.4
>            Reporter: Mark
>            Priority: Minor
> Issue IO-226 is not fixed but closed.
> ?
> Here is my solution that also support a user-defined precision in terms of a maximum
length of the digits part.

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:

View raw message