number formatting - JSTL padding int with leading zeros -
i'm trying use jstl build form. have select input months need months 2 digits i.e. padded left 0 1-9.
i have obvious doesn't give me want.
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <select class="forminput"> <c:foreach var="i" begin="1" end="12" step="1" varstatus ="status"> <option><fmt:formatnumber pattern="##" value="${i}" /></option> </c:foreach> </select>
this has have been done before can't find example after bit of searching.
found answer: minintegerdigits
<select class="forminput"> <c:foreach var="i" begin="1" end="12" step="1" varstatus ="status"> <option><fmt:formatnumber minintegerdigits="2" value="${i}" /></option> </c:foreach> </select>
Comments
Post a Comment