Laurent Fallet wrote:
Hello everybody,
I'm using Struts with delight, even if I have a small problem : I'm trying to format a number in a <html:text> tag. I know it is possible in <bean:write> tag with format or formatkey attribute. But after a failed validation, my initial number (32 for example) come back as "32.0" and I would like to have it as "32.00" I'm using the type Float for the form field (not String). Is there a way to do that?
Thanks,
Laurent

I think you can use the html:text tag body to specify the formatted value you want, something like this:

  <html:text property="foo">
    <bean:write name="MyForm" property="foo" format="##.##"/>
  </html:text>

If that doesn't work, you can use jsp:attribute to set html:text's 'value' attribute, something like:

  <html:text property="foo">
    <jsp:attribute name="value">
      <bean:write name="MyForm" property="foo" format="##.##"/>
    </jsp:attribute>
  </html:text>

HTH,

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to