Java tutorial
//package com.java2s; public class Main { public static String MemoryToString(long l) { return (new StringBuilder(String.valueOf(String.valueOf(l / 1024L / 1024L)))).append("M").toString(); } }