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 ...
随机推荐
- 实现3D摄像机缓冲系统的一些思考
最近需要模拟红侠乔伊的镜头运用.这东西初看简单,实际还是很需要功夫的.关键不是程序技术如何(就一个摄像机),而是分析其轨迹和追踪点规律.其实就是一个3D空间中的缓冲系统.你如何确定都有什么参数,这么多 ...
- leetcode:ZigZag Conversion 曲线转换
Question: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of ...
- Ubuntu 下一个可用的音乐播放器
参考:http://www.pairsdoll.com/install-audacious-music-palyer-in-ubuntu.html/ 方法:打开terminal,sudo apt-ge ...
- [WebService]之Schema
schema入门 1:schema出现的目的是通过一个更加合理的方式来编写xml文件的限制(以XML语法的方式) 2:schema可以使用命名空间来支持多个名称相同的元素 3:schema可以很好的的 ...
- 转】MyEclipse10安装Log4E插件
原博文出自于:http://www.cnblogs.com/xdp-gacl/p/4231812.html 感谢! 一. Log4E插件下载 下载地址:http://log4e.jayefem.de/ ...
- delphi 集合
DELPHI没有JAVA的丰富的集合(SET MAP LIST),只有Tlist,可包装各种类型
- C++11角括号
[C++11角括号] 标准 C++ 的剖析器一律将 ">>" 视为右移运算符. 但在样板定义式中,绝大多数的场合其实都代表两个连续右角括号. 为了避免剖析器误判,撰码时 ...
- IMAQdx和IMAQ
NI-IMAQdx driver software gives you the ability to acquire images with IEEE 1394 and GigE Vision cam ...
- JQuery与GridView控件结合示例
JQuery是一种非常强大的客户端JS编程技术,这里不想过多阐述它的相关背景知识,只想简单演示一下如何与asp.net的控件结合开发. 比如,我们要做一个下面如图所示的功能,效果是状态.编号.数字1. ...
- FZU 2129 子序列个数 (递推dp)
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2129 dp[i]表示前i个数的子序列个数 当a[i]在i以前出现过,dp[i] = dp[i - 1]*2 - ...