jstl_fmt_ex.jsp
페이지 정보
본문
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<title>JSTL fmt 라이브러리 사용 예제</title>
</head>
<body>
<fmt:formatNumber value="100200300.45" type="number"/><br>
<fmt:formatNumber value="50000" type="currency"/><br>
<fmt:formatNumber value="50000" type="currency" currencySymbol="원"/><br>
<fmt:formatNumber value="0.15" type="percent"/><br>
<fmt:formatNumber value="500567300" pattern="###,###,###"/><br><br>
<%
int num=50000;
int num2=500567300;
%>
<c:set var="num" value="0.15"/>
<c:set var="num2" value="500567300"/>
<fmt:formatNumber value="<%=num %>" type="currency"/><br>
<fmt:formatNumber value="${num }" type="percent"/><br>
<fmt:formatNumber value="<%=num2 %>" pattern="###,###,###"/><br>
<fmt:formatNumber value="${num2 }" pattern="###,###,###"/><br><br>
<jsp:useBean id="date" class="java.util.Date"/>
<fmt:formatDate value="${date}" type="date"/><br>
<fmt:formatDate value="${date}" type="time"/><br>
<fmt:formatDate value="${date}" type="both"/><br><br>
<fmt:formatDate value="${date}" type="both" timeStyle="short" dateStyle="short"/><br>
<fmt:formatDate value="${date}" type="both" timeStyle="long" dateStyle="long"/><br><br>
</body>
</html>
- 이전글● JSTL(JSP Standard Tag Library) fmt 21.07.15
- 다음글● JSTL(JSP Standard Tag Library) core 21.07.15
댓글목록
등록된 댓글이 없습니다.