Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to format a number in <html:text/>

843838Apr 14 2006 — edited Apr 18 2006
Hey all,
I have a form bean with a few floats. When these floats are displayed I would like them formatted as currency (#,##0.0). Here is what I have so far using the <fmt:formatNumber/> tag but that doesn't seem to work how I want.
<td align="left" class="tableHeader">
   <fmt:formatNumber value="${spendplanEditProjectBean.actualFunding}" type="currency" pattern="#,##0" />
   <html:text property="actualFunding" />
</td>
This just displays the float as currency NEXT to the text box. How do I get it in the text box.

I am also wondering if I should change this float to a String in the form bean, and then worry about converting it to a float latter on in my Action class? Is it proper to declare all form variables as Strings?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2006
Added on Apr 14 2006
3 comments
258 views