Use the formatting classes in java.text, for example java.text.NumberFormat.
Here is an example:
<%
java.text.NumberFormat nf =
java.text.NumberFormat.getCurrencyInstance();
// your sql stuff here
while (rs.next()) {
%>
<%= nf.format(rs.getDouble("price")) %>
<%
}
%>
This is also a great opportunity for creating a custom tag.
Christophe
-----Original Message-----
From: Rich Tretola
To: JRun-Talk
Sent: 9/3/2001 9:33 AM
Subject: RS Formating
How do I format a result set in JSP?
dolarformat, numberformat, dateformat, etc.?
Thanks,
Rich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists