Hi there,

can somebody help me out with the float problem i'm having. I am new with
JSP.
i try to convert a string to a float to do a calculation in jsp, but the
results turn out to be not what i expected, here are my code:
....
<% float SumTotalValue = 0 ;%>

<repeat index = i>
<%bnViewPOCHolder.getPO_No(i);%>

       <% float TotalValue = new
Float(bnViewPOCHolder.getNet_Total(i)).floatValue();%>
                 <% SumTotalValue = SumTotalValue + TotalValue ;%>
</repeat>
<%=a.format(SumTotalValue)%>
........

Sometimes i get a float number like 522.061 instead of 522.06 and sometimes
it's ok.
What should i do? How can i set the decimal places to 2?

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to