Skip to content

Commit e697954

Browse files
committed
IO-226 - document rounding behaviour
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@919253 13f79535-47bb-0310-9956-ffa450edef68
1 parent 95b0ab8 commit e697954

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/java/org/apache/commons/io/FileUtils.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,16 @@ public static FileOutputStream openOutputStream(File file) throws IOException {
189189
/**
190190
* Returns a human-readable version of the file size, where the input
191191
* represents a specific number of bytes.
192+
*
193+
* If the size is over 1GB, the size is returned as the number of whole GB,
194+
* i.e. the size is rounded down to the nearest GB boundary.
195+
*
196+
* Similarly for the 1MB and 1KB boundaries.
192197
*
193198
* @param size the number of bytes
194-
* @return a human-readable display value (includes units)
199+
* @return a human-readable display value (includes units - GB, MB, KB or bytes)
195200
*/
201+
// See https://issues.apache.org/jira/browse/IO-226 - should the rounding be changed?
196202
public static String byteCountToDisplaySize(long size) {
197203
String displaySize;
198204

0 commit comments

Comments
 (0)