java 自定义四舍五入
package learnjava;
class UMath{
public UMath() {
}
public static double round(double num,int scale) {
return Math.round(numMath.pow(10, scale))/Math.pow(10,scale);
}
}
pu*blic class Math_Test {
public static void main(String[] args) {
System.out.println(MathUtil.round(19.86273, 2));
}
}