format函数: 格式化浮点数 format(number, length); Formats the number X to a format like '#,###,###.##', rounded to D decimal places, and returns the result as a string. If D is 0, the result has no decimal point or fractional part. D should be a constant
一.Math类 Math类常用的方法: public static long abs (double a) 返回a的绝对值 public static double max (double a,double b) 返回a.b的最大值 public static double min (double a,double b) 返回a.b的最小值 public static double pow (double a,double b) 返回a的b次幂 public static double sqrt
用oracle sql对数字进行操作: 取上取整.向下取整.保留N位小数.四舍五入.数字格式化 取整(向下取整): select floor(5.534) from dual; select trunc(5.534) from dual; 上面两种用法都可以对数字5.534向下取整,结果为5. 如果要向上取整 ,得到结果为6,则应该用ceil select ceil(5.534) from dual; 四舍五入: SELECT round(5.534) FROM dual; ) FROM dua