You could define a small method which takes a float
value and converts to a String with the proper
precision, and then call this method in a JSP scriplet.
ie.
<%!
public String convertToString( float _value )
{
String stringValue = null;
...
return stringValue;
}
%>
...
<%= convertToString(floatValue) %>
------Original Message------
From: "Jay H. Lang" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: December 8, 2000 2:05:20 PM GMT
Subject: Display of money
Hi All,
I am using a float variable in a JSP to total some values. Once totaled
I use the variable on the out display. When I have two non-zero values
to the right of the decimal it shows fine, i.e 1.53. When my last digit
is a zero it shows, 1.5, leaving off the trailing zero. I have looked
and can't seem to find an Object or variable type I can convert this to,
just prior to its display to get the trailing zero to print.
Thanks for any help given.
--
Jay H. Lang
Chief Technologist
Distributed Computing Professionals Inc.
IBM Certified Specialist - MQSeries
303 277-1873 - Office
303 807-9700 - Cell
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
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
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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