Java 文件大小以M为单位计算方法
DecimalFormat df = new DecimalFormat( "0.## ");
Float si=mfile.getSize()/1024f/1024f;
System.out.println(df.format(si)+"M");
DecimalFormat df = new DecimalFormat( "0.## ");
Float si=mfile.getSize()/1024f/1024f;
System.out.println(df.format(si)+"M");