Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Number format is JSP when using JSTL <sql:query> along with <c:forEach> tag. Simple  beginners question !!

Posted on 2006-05-15
1
Medium Priority
?
1,206 Views
Last Modified: 2013-11-24
Hello I am using <sql:query> along with <c:forEach> tag to display contents of a database table. It works fine.
But now i want to format the numeric values returned from the Select statement.


for example. In the code below the col1 values returned from sql are numeric without any 1000 separator commas. Eg 1000, 10000, 1000000 etc.

I want to format them to display 1000 separator commans i.e 1,000, 10,000, 1000,000 etc. How can I do it ?

<sql:query> ...</sql:query>
<TABLE>
<c:forEach>
  <tr>
     <td><c:out value="${row.col1}" /></td>
   </tr>

</c:forEach>
</TABLE>
0
Comment
Question by:MFCAnswer
1 Comment
 
LVL 4

Accepted Solution

by:
evnafets earned 1200 total points
ID: 16686856
Instead of the <c:out> tag try using <fmt:formatNumber value="${row.col1}"/>
That should format the number correctly for your locale.


0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question