mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Required for r371
This commit is contained in:
parent
61aba8fa78
commit
0bf5dcf95b
26
src/com/android/email/activity/SizeFormatter.java
Normal file
26
src/com/android/email/activity/SizeFormatter.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package com.android.email.activity;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.android.email.R;
|
||||||
|
|
||||||
|
public class SizeFormatter
|
||||||
|
{
|
||||||
|
public static String formatSize(Context context, long size)
|
||||||
|
{
|
||||||
|
if (size > 1024000000)
|
||||||
|
{
|
||||||
|
return ((float)(size / 102400000) / 10) + context.getString(R.string.abbrev_gigabytes);
|
||||||
|
}
|
||||||
|
if (size > 1024000)
|
||||||
|
{
|
||||||
|
return ((float)(size / 102400) / 10) + context.getString(R.string.abbrev_megabytes);
|
||||||
|
}
|
||||||
|
if (size > 1024)
|
||||||
|
{
|
||||||
|
return ((float)(size / 102) / 10) + context.getString(R.string.abbrev_kilobytes);
|
||||||
|
}
|
||||||
|
return size + context.getString(R.string.abbrev_bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user