struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akoo <>
Subject number formatting (with commas)
Date Fri, 01 May 2009 17:01:57 GMT

Hi guys, 
I have looked through all of the documentations and am just not having any
success formatting numbers (i.e 70333 -> 70,333)  so I thought i'd ask you
guys.  here are relevant snippets of my code.

  <s:iterator value="positions">

              <td><s:property value="account"/> </td>
              <td ><s:property value="symbol"/> </td>
              <td><s:text name="format.number"><s:param name="value"

Positions in the above code is a list of position objects 
class Position
    private String symbol;
    private String account;
    private float netpl;
    //followed by getters and setters for all of the above field

The Action class FirmwidePositionAction  returns the list of positions after
querying the the database

What I want is for the netpl number to show up formatted properly with the
comma placeholders and a 'USD' prefix,  so I created the
file and placed it in the same package as the action class.
Here is my file

format.time = {0,time}
format.number = USD{0,number,##0.00}
format.percent = {0,number,##0.00'%'} = {0,number,\u00A4##0.00}

The numbers all show up perfectly. However, I am not able to get the 'USD'
to appear in front of the netpl columns.  What am I doing wrong here?


View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message