jstl <fmt:formatNumber>标签
标签用于格式化数字,百分比和货币。

- 如果type属性为百分比或数字,则可以使用多个数字格式属性。maxIntegerDigits和minIntegerDigits属性允许您指定数字的非分数部分的大小。如果实际数字超过maxIntegerDigits,则数字将被截断。
- 还提供了属性以允许您确定应使用多少个小数位。 minFractionalDigits和maxFractionalDigits属性允许您指定小数位数。如果数字超过了小数位数的最大数字,则数字将被四舍五入。
- 分组可用于在千位组之间插入逗号。 通过将groupingIsUsed属性设置为true或false来指定分组。 当与minIntegerDigits一起使用分组时,必须小心获取预期的结果。
- 可以选择使用pattern属性。 此属性允许您包含指定您的编号编码的特殊字符。下表列出了代码:

## 示例##
文件:fmt_formatNumber.jsp -
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
<b>账户余额</b> <a class="pull-right">¥<fmt:formatNumber value="${rpAccount.availableBalance }" pattern="0.00" /></a>
</li>
<li class="list-group-item">
<b>可结算余额</b> <a class="pull-right">¥<fmt:formatNumber value="${rpAccount.availableSettAmount }" pattern="0.00" /></a>
</li>
<li class="list-group-item">
<b>冻结金额</b> <a class="pull-right">¥<fmt:formatNumber value="${rpAccount.unbalance }" pattern="0.00" /></a>
</li>
<li class="list-group-item">
<b>今日收益</b> <a class="pull-right">¥<fmt:formatNumber value="${rpAccount.todayIncome }" pattern="0.00" /></a>
</li>
<li class="list-group-item">
<b>今日支出</b> <a class="pull-right">¥<fmt:formatNumber value="${rpAccount.todayExpend }" pattern="0.00" /></a>
</li>
</ul>
jstl <fmt:formatNumber>标签的更多相关文章
- jstl的formatNumber标签的四舍五入问题
jstl的formatNumber标签的四舍五入问题 近日使用JSTL的formatNumber 标签进行四舍五入时,发现它竟然使用的是"4舍6入5奇偶"的算法. 要实现" ...
- <fmt:formatNumber>标签
<fmt:formatNumber>标签用于格式化数字,百分比,货币. 属性 <fmt:formatNumber>标签有如下属性: 属性 描述 是否必要 默认值 value 要 ...
- jstl <fmt:formatDate>标签
<fmt:formatDate>标记用于在各种不同的方式来格式化日期 属性: <fmt:formatDate>标签具有以下属性: 属性 描述 必需 默认值 value 要显示的 ...
- JSTL fmt:formatNumber 数字、货币格式化
<fmt:formatNumber value="12.34" pattern="#0.00" /> 12.34 保留小数点后两位数 <fmt ...
- JSTL——formatNumber标签
使用场合: <fmt:formatNumber>标签用于格式化数字,百分比,货币 属性: 语法 如果使用pattern属性.这个属性可以让您在对数字编码时包含指定的字符.接下来的表格中列出 ...
- (2)JSTL的fmt国际化标签库
format标签库:做国际化格式化,分两类 : 国际化核心标签:<fmt:setLocale>.<fmt:bundle>.<fmt:setBundle>.<f ...
- JSTL 数字日期标签库
<frm:formatNumber/>标签 该标签依据特定的区域将数字改变为不同的格式来显示. 被格式化的数据<frm:formatNumber> <fmt:format ...
- jstl fmt标签的使用
所有标签 fmt:requestEncoding fmt:setLocale fmt:timeZone fmt:setTimeZone fmt:bundle fmt:setBundle fmt:mes ...
- fmt:formatNumber use locale display negative currency in -$xxx.xx format in JSTL
First, we want to know our own locale,how to display the locale in a JSTL? <c:out value="${p ...
随机推荐
- vc++之stdafx.h
关于stdafx.h的解释,其实蛮多的,在vs中,既然创建c++工程的时候,默认会给生成main.cpp,并且自动包含了stdafx.h,而且stdafx.h不是c++标准的一部分,那么个人认为,理解 ...
- 20145330 《网络攻防》 MSF基础应用
20145330 <网络攻防> MSF基础应用 1.实验后回答问题 (1)用自己的话解释什么是exploit,payload,encode. exploit:进行渗透攻击的模块合集 pay ...
- 2018-2019-1 1723《程序设计与数据结构》第5&6&7周作业 总结
作业地址 第五周作业: 提交情况如图: 第六周作业: 提交情况如图: 第七周作业: 提交情况如图: 作业问题 很多看上写的比较详细并且语言组织的也不错,我就这么随手一百度,搜出来了很多篇博客.(无奈) ...
- 探索Java8:Stream的使用
Java 8 API添加了一个新的抽象称为流Stream,可以让你以一种声明的方式处理数据. Stream 使用一种类似用 SQL 语句从数据库查询数据的直观方式来提供一种对 Java 集合运算和表达 ...
- Linux设备驱动中的IO模型---阻塞和非阻塞IO【转】
在前面学习网络编程时,曾经学过I/O模型 Linux 系统应用编程——网络编程(I/O模型),下面学习一下I/O模型在设备驱动中的应用. 回顾一下在Unix/Linux下共有五种I/O模型,分别是: ...
- HDU1556 Color the ball(差分数组)题解
Color the ball Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...
- Wannafly 挑战赛22 D 整数序列 线段树 区间更新,区间查询
题目链接:https://www.nowcoder.com/acm/contest/160/D 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K ...
- c#传统SqlTransaction事务和TransactionScope事务
事务有很多种,看了一些关于事务的问题,这里做下笔记····· 事务时单个的工作单位.如果某一事务成功,则在该事务中进行的所有数据更改均会提交,成为数据库中永久的组成部分.若果事务遇到错误,则必须取消或 ...
- 03_Flume多节点Failover实践
1.实践场景 模拟上游Flume Agent在发送event时的故障切换 (failover) 1)初始:上游Agent向active的下游节点Collector1传递event 2)Collecto ...
- spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes
spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...