public static String CountFileSize(long size){
if(size<1024l){
return size+"B";
}else if(size<(1024l*1024l)){
return Math.round((size*100>>10))/100.00+"KB";
}else if(size<(1024l*1024l*1024l)){
return (Math.round((size*100>>20))/100.00)+"MB";
}else {
return Math.round((size*100>>30))/100.00+"GB";
}
}
if(size<1024l){
return size+"B";
}else if(size<(1024l*1024l)){
return Math.round((size*100>>10))/100.00+"KB";
}else if(size<(1024l*1024l*1024l)){
return (Math.round((size*100>>20))/100.00)+"MB";
}else {
return Math.round((size*100>>30))/100.00+"GB";
}
}