Hi guys,
I am changing an already developed Spring application.. All I need to do is to put a format the float number to two decimal digits...I am trying to use JSTL formatNumber, but somehow its not picking the data in the bean.. any help would be very appreciable.. here is a little snippet of the code
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<c:if test="${requestScope.data != null}">
<table id='dataArea'>
<tr>
<td class='tdGrey bleft btop' style='width: 160px;'><spring:message
code="chapter_three.maximum_daily_rate.label" />:</td>
<td class='btop'>${requestScope.data.maxDailyRate}</td>
</tr>
<tr>
<td class='tdGrey bleft btop'><spring:message
code="chapter_three.regular_open_hour_per_week.label" />:</td>
<td class='btop'>${requestScope.data.regularOpenHourPerWeek}</td>
</tr>
....
*${requestScope.data.maxDailyRate}* correctly prints the floating number, say 50.0
if I change this to
*<fmt:formatNumber maxFractionDigits="2" minFractionDigits="2" value="${requestScope.data.maxDailyRate}"></fmt:formatNumber>* that somehow doesn't work, although I dont get any exception.. when I say doesn't work, I see no change in the page.
I am using Tomcat 5.5.23 and Java 1.6..
Any ideas, Please
Thanks