参考这段代码:
DecimalFormat decimalFormat=new DecimalFormat(".00"); int i = 100; int j = 9; float f = (float)i/j; String p=decimalFormat.format(f); System.out.println(p);