Skip to content

Commit

Permalink
Update localized file size util method to handle under 1 kb sizes and…
Browse files Browse the repository at this point in the history
… GB sizes.
  • Loading branch information
box-android-jenkins committed Jul 19, 2017
1 parent 8d31d9c commit 2037353
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ public static int calculateInSampleSize(BitmapFactory.Options options, int reqWi



private static String SIZE_BYTES = "%4f B";
private static String SIZE_BYTES = "%4.0f B";
private static String SIZE_KILOBYTES = "%4.1f KB";
private static String SIZE_MEGABYTES = "%4.1f MB";
private static String SIZE_GIGABYTES = "%4.1f GB";
Expand All @@ -647,8 +647,8 @@ public static int calculateInSampleSize(BitmapFactory.Options options, int reqWi

private static final int constKB = 1024;
private static final int constMB = constKB * constKB;
private static final int constGB = constMB * constKB;
private static final int constTB = constGB * constKB;
private static final double constGB = constMB * constKB;
private static final double constTB = constGB * constKB;

private static final double floatKB = 1024.0f;
private static final double floatMB = floatKB * floatKB;
Expand Down
2 changes: 1 addition & 1 deletion box-content-sdk/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@



<string name="boxsdk_bytes" description="size with abbreviation for bytes used in folder list">%4f B</string>
<string name="boxsdk_bytes" description="size with abbreviation for bytes used in folder list">%4.0f B</string>
<string name="boxsdk_kilobytes" description="size in binary kilobytes 1024 bytes used in folder list">%4.1f KB</string>
<string name="boxsdk_megabytes" description="size in binary megabyte 1024 * 1024 kbytes used in folder list">%4.1f MB</string>
<string name="boxsdk_gigabytes" description="size in binary gigabyte 1024 * 1024 mbytes used in folder list">%4.1f GB</string>
Expand Down

0 comments on commit 2037353

Please sign in to comment.