mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-27 06:41:15 +00:00
Commented original source of readable file size/transfer rate functions.
This commit is contained in:
parent
512b79fff1
commit
867e5d1ede
1 changed files with 4 additions and 0 deletions
|
@ -509,6 +509,8 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a number of bytes to a human readable file size (eg 3.5 GiB).
|
* Converts a number of bytes to a human readable file size (eg 3.5 GiB).
|
||||||
|
*
|
||||||
|
* Based on http://stackoverflow.com/a/5599842
|
||||||
*/
|
*/
|
||||||
public static String readableFileSize(Context context, long bytes) {
|
public static String readableFileSize(Context context, long bytes) {
|
||||||
final String[] units = context.getResources().getStringArray(R.array.file_size_units);
|
final String[] units = context.getResources().getStringArray(R.array.file_size_units);
|
||||||
|
@ -521,6 +523,8 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
/**
|
/**
|
||||||
* Converts a number of bytes to a human readable transfer rate in bytes per second
|
* Converts a number of bytes to a human readable transfer rate in bytes per second
|
||||||
* (eg 100 KiB/s).
|
* (eg 100 KiB/s).
|
||||||
|
*
|
||||||
|
* Based on http://stackoverflow.com/a/5599842
|
||||||
*/
|
*/
|
||||||
public static String readableTransferRate(Context context, long bits) {
|
public static String readableTransferRate(Context context, long bits) {
|
||||||
final String[] units = context.getResources().getStringArray(R.array.transfer_rate_units);
|
final String[] units = context.getResources().getStringArray(R.array.transfer_rate_units);
|
||||||
|
|
Loading…
Reference in a new issue