Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsnumber formatting in JSP
https://www.eclipse.org/forums/index.php/mv/msg/64867/204201/#msg_204201
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?
</TR>]]>2007-04-10T16:20:55-00:00Re: number formatting in JSP
https://www.eclipse.org/forums/index.php/mv/msg/64867/204250/#msg_204250
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 :-)]]>2007-04-10T19:56:01-00:00Re: number formatting in JSP
https://www.eclipse.org/forums/index.php/mv/msg/64867/204281/#msg_204281
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.