Java tutorial
//package com.java2s; import android.content.Context; import android.text.format.Formatter; public class Main { public static String getSizeText(Context context, long currentBytes, long totalBytes) { StringBuffer sizeText = new StringBuffer(); if (totalBytes > 0) { sizeText.append(Formatter.formatFileSize(context, currentBytes)); sizeText.append("/"); sizeText.append(Formatter.formatFileSize(context, totalBytes)); } return sizeText.toString(); } }