Here you can find the source of convertLongToMega(long value)
private static String convertLongToMega(long value)
//package com.java2s; //License from project: Open Source License public class Main { private static final long MEGA = 1024 * 1024; private static String convertLongToMega(long value) { long megaValue = value / MEGA; String result = Long.toString(megaValue) + " MB"; return result; }// w w w . j a v a2s . c o m }