1.trunc函数 1).trunc(date) 格式:trunc(date,fmt) trunc用于截取时间,即便你指定不同的格式类型,返回的类型始终都是时间类型. 示例: with dates as ( select date'2015-01-01' d from dual union select date'2015-01-10' d from dual union select date'2015-02-01' d from dual union select timestamp'201…
在 JAVA 中四舍五入采用 Math.round(T a) 函数,函数返回的是一个 long 类型的长整型,参数 a 可以是 double 也可以是 float. 查看 JDK 源码: public static long round(double a) { if (a != 0x1.fffffffffffffp-2) // greatest double value less than 0.5 return (long)floor(a + 0.5d); else return 0; } pu…
代码 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> &…