Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

s:iterator question

 
aaron walker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using an s:iterator tag to display information from a data base. It is only for display, but I need it to show formatted as currency. Is there a way to do this on the jsp? Or is it better just to format it on the database? I would need the coverageAmount to show as a formatted number.

Here is my iterator:


Thanks in advance
 
Mike Cobelmach
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its easy, you can found it on Struts pages.

In package.properties you would have



And your code would look like this



Btw on linked page is misstake in last example - formated value is in single quotes.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currency can be formatted using the <s:text> tag:

http://struts.apache.org/2.1.6/docs/formatting-dates-and-numbers.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic