java学习笔记

45 阅读1分钟

四舍五入保留两位小数

public static double sswr(double x)
	{
		int y=(int)(x*100+0.5);
		double z=y/100.0;
		return z;
	}