Another thing is that your example, according to the example provided on the web site, is not correct either.
<s:text name="format.money"> <s:param name="value" value="%{#session.Account.balance}"/> </s:text> format.money should actually be one of the values { 0, number, currency }, at least that is what it says on the documentation page. I wish someone from the Struts team would give a better example on this. Thank you to all that have replied and will still reply. Solution NOT yet found. Harring On 4/11/07, Harring Figueiredo <[EMAIL PROTECTED]> wrote:
Hi Laurie, Thanks for the response. I tried what you suggested, and actually did not get a value back (empty). Where should I set the resource string? (I thought it was _smart_ enough to get from the Locale. Thank you. On 4/11/07, Laurie Harper <[EMAIL PROTECTED]> wrote: > > Harring Figueiredo wrote: > > Folks: > > > > It is clear that I MUST be doing something wrong, but I have tried all > the > > options with the <s:text> to format a number. > > > > Here is what I have tried: > > <li><s:text name="currency"><s:param name="money" > > value="%{#session.Account.balance}"/></s:text></li> > > <li><s:text name="format.money "><s:param name="money" > > value="%{#session.Account.balance}"/></s:text></li> > > <li><s:text name="currency"><s:param name="money" value=" 122.3333 > > "/></s:text></li> > > <li><s:text name="format.money"><s:param name="money" value="122.3333 > > "/></s:text></li> > > <li><s:text name="currency"><s:param value="122.3333"/></s:text></li> > > <li><s:text name="currency"><s:param value='122.3333'/></s:text></li> > > <li><s:text name="currency"><s:param name="money"> 1111.199999999 > > </s:param> > > </s:text></li> > > <li><s:text name="currency"><s:param> 1111.199999999 </s:param> > > </s:text></li> > > <li><s:property value="%{#session.Account.balance}"/></li> > > > > > > And Here is the Corresponding output on the page: > > currency > > format.money > > currency > > format.money > > currency > > currency > > currency > > currency > > 1003.9999999999999 > > > > What in the world ami I missing? ( I am wither misreading the > example, or > > it is clearly not correct. I hope it is the former) > > > > I followed the example on this page: > > http://struts.apache.org/2.x/docs/text.html > > > > Other example > > > > <s:text name="format.money"><s:param name="value" > > value="myMoneyValue"/></s:text> > > > > where > > > > format.money={0,number,currency} > > > > > > Thank you in advance for any input. > > > > hf > > > > None of your attempts actually follows the example, though; you're using > <s:param name="money" ... instead of <s:param name="value" ... > > Try this: > > <s:text name="format.money"> > <s:param name="value" > value="%{#session.Account.balance}"/> > </s:text> > > From your sample output it looks like you haven't set up the > format.money or currency resource strings, either, which you will need > to do. > > L. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Sincerely, Harring Figueiredo Sr. Software Engineer Email: [EMAIL PROTECTED] Telephone: 941-256-0600 "We never become truly spiritual by sitting down and wishing to become so. You must undertake something so great that you cannot accomplish it unaided."
-- Sincerely, Harring Figueiredo Sr. Software Engineer Email: [EMAIL PROTECTED] Telephone: 941-256-0600 "We never become truly spiritual by sitting down and wishing to become so. You must undertake something so great that you cannot accomplish it unaided."