number formatting in JSP [message #204201] |
Tue, 10 April 2007 16:20 |
Eclipse User |
|
|
|
Originally posted by: b0pror00t0r.hotmail.com
Hello!
I'm trying to display correctly formatted prices in an table (using JSP)
System.out.printf("%2.2%n",price); displays it correctly in the console.
What would I need to do to show it formatted correctly in the outputted
HTML?
Stugan
<TR>
<TD><font color="#FFFFFF"><%= code %></TD>
<TD><font color="#FFFFFF"><%= description %></TD>
<TD><font color="#FFFFFF"><%= currentLevel %></TD>
<TD><font color="#FFFFFF"><%= reorderLevel %></TD>
<TD><font color="#FFFFFF"><% System.out.printf("%2.2f%n",price); %></TD>
</TR>
|
|
|
Re: number formatting in JSP [message #204250 is a reply to message #204201] |
Tue, 10 April 2007 19:56 |
Eclipse User |
|
|
|
Originally posted by: nowhere.a.com
Stugen Palma wrote :
> Hello!
> I'm trying to display correctly formatted prices in an table (using JSP)
> System.out.printf("%2.2%n",price); displays it correctly in the console. What
> would I need to do to show it formatted correctly in the outputted HTML?
>
> Stugan
>
>
> <TR>
> <TD><font color="#FFFFFF"><%= code %></TD>
>
> <TD><font color="#FFFFFF"><%= description %></TD>
>
> <TD><font color="#FFFFFF"><%= currentLevel %></TD>
>
> <TD><font color="#FFFFFF"><%= reorderLevel %></TD>
>
> <TD><font color="#FFFFFF"><% System.out.printf("%2.2f%n",price); %></TD>
>
> </TR>
String.format("%2.2f%n",price);
--
Wojtek :-)
|
|
|
Re: number formatting in JSP [message #204281 is a reply to message #204201] |
Tue, 10 April 2007 22:15 |
Eclipse User |
|
|
|
Originally posted by: eclipse5.rizzoweb.com
Stugen Palma wrote:
> Hello!
> I'm trying to display correctly formatted prices in an table (using JSP)
> System.out.printf("%2.2%n",price); displays it correctly in the console.
> What would I need to do to show it formatted correctly in the outputted
> HTML?
This is not an Eclipse-related question and would be better served on a
JEE or JSP forum. Please restrict postings to this newsgroup to
Eclipse-related content.
Having said that, to help you out I will point you to JSTL which
contains formatting tag that do exactly what you want. Google for "JSTL
format tag" and you'll find it.
Hope this helps,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.08525 seconds