freemarker中的round、floor和ceiling数字的舍入处理
freemarker中的round、floor和ceiling数字的舍入处理
1、简易说明
(1)round:四舍五入
(2)floor:向下取整
(3)ceiling:向上取整
2、举例说明
<#--freemarker中的round、floor和ceiling数字的舍入处理-->
<#--round:四舍五入-->
<#--floor:向下取整-->
<#--ceiling:向上取整--> <#assign numList = [12,0.23,89,12.03,69.56,45.67,-0.56,-8.05,-89.56,4.69]/>
<#list numList as num>
${num} ?round=${num?round} ?floor=${num?floor} ?ceiling=${num?ceiling}
</#list>
3、演示样例结果
<span style="white-space:pre"> </span> 12 ?round=12 ?floor=12 ?ceiling=12
0.23 ?round=0 ?floor=0 ?ceiling=1
89 ?round=89 ?floor=89 ?ceiling=89
12.03 ?round=12 ?floor=12 ?ceiling=13
69.56 ?round=70 ?floor=69 ?ceiling=70
45.67 ?round=46 ?floor=45 ?ceiling=46
-0.56 ?round=-1 ?floor=-1 ?ceiling=0
-8.05 ?round=-8 ?floor=-9 ?ceiling=-8
-89.56 ?round=-90 ?floor=-90 ?ceiling=-89
4.69 ?round=5 ?floor=4 ?ceiling=5
freemarker中的round、floor和ceiling数字的舍入处理的更多相关文章
- freemarker中的round、floor和ceiling数字的舍入处理(十七)
1.简易说明 (1)round:四舍五入 (2)floor:向下取整 (3)ceiling:向上取整 2.举例说明 <#--freemarker中的round.floor和ceiling数字的舍 ...
- C++中的 Round(),floor(),ceil()
2.1 2.6 -2.1 -2.6floor : 不大于自变量的最大整数 2 ...
- Freemarker中遍历List以及内置函数使用
在Freemarker应用中经常会遍历List获取需要的数据,并对需要的数据进行排序加工后呈现给用户. 那么在Freemarker中如何遍历List,并对List中数据进行适当的排序呢?一. Free ...
- SQL 中详解round(),floor(),ceiling()函数的用法和区别?
SQL 中详解round(),floor(),ceiling()函数的用法和区别? 原创 2013年06月09日 14:00:21 摘自:http://blog.csdn.net/yueliang ...
- SQL语句(floor、ceiling和round以及left和right)
前言:个人认为命令没有必要记,学过的知识总结一下,用到了可以快速找到派上用场.用的多了,自然会记住,但是一定要理解每一个字符代表的是什么,多一个少一个会怎么样 要点概述 floor 和ceiling和 ...
- oracle中 trunc(),round(),ceil(),floor的使用
oracle中 trunc(),round(),ceil(),floor的使用 原文: http://www.2cto.com/database/201310/248336.html 1.round函 ...
- js中Math.round、parseInt、Math.floor和Math.ceil小数取整总结(转)
js中Math.round.parseInt.Math.floor和Math.ceil小数取整总结 Math.round.parseInt.Math.floor和Math.ceil 都可以返回一个整数 ...
- 关于python中的round()和javascript中的round()的比较
ps:python的round()和javascript的round()的比较: javascript:Math.round():正常的标准舍入,就像我们学的数学课本上面的规则 python:pyth ...
- Python 中关于 round 函数的坑
round函数很简单(而且不需要引入math模块),对浮点数进行近似取值,保留几位小数. 比如 # -*- coding: UTF-8 -*- r1=round(12.12345,3) r2=roun ...
随机推荐
- LoadRunner界面分析(二)
1.Controller 2.创建运行场景 3.方案设计 4.Resuls settting 5.监视方案
- <转>如何利用多核CPU来加速你的Linux命令 — awk, sed, bzip2, grep, wc等
原文链接:http://www.vaikan.com/use-multiple-cpu-cores-with-your-linux-commands/ 你是否曾经有过要计算一个非常大的数据(几百GB) ...
- 【转】GUID学习
概念 GUID: 即Globally Unique Identifier(全球唯一标识符) 也称作 UUID(Universally Unique IDentifier) . GUID是一个通过特定算 ...
- 为operamasks增加HTML扩展方式的组件调用
#为operamasks增加HTML扩展方式的组件调用 ##背景 之前的[博文](http://www.cnblogs.com/p2227/p/3540858.html)中有提及到,发现easyui中 ...
- Linux下静态库生成和使用
Linux下静态库生成和使用 一.静态库概念 1.库是预编译的目标文件(object files)的集合,它们可以被链接进程序.静态库以后缀为”.a”的特殊的存档(archive file)存储. ...
- Cocos本地存储LocalStorage
HTML5 LocalStorage 本地存储 //存档 var stopResumeMenu4 = cc.MenuItemFont.create("存档", this.onSav ...
- dom 侧栏分享
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- android学习笔记(入门篇)
+号只是当你第一次定义一个资源ID的时候需要, 告诉SDK此资源ID需要被创建出来 对于所有的View默认的权重是0,如果你只设置了一个View的权重大于0,那么这个View将占据除去别的View本身 ...
- Windows 2003 服务器安全设置-批处理 (附参考链接)
长期维护windows服务器终结出来的安全设置批处理与大家分享,复制以下全部内容用记事本另存为bat或者cmd执行 ===================分隔符号=================== ...
- HDU 5794 A Simple Chess (Lucas + dp)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5794 多校这题转化一下模型跟cf560E基本一样,可以先做cf上的这个题. 题目让你求一个棋子开始在( ...