• Post Reply Bookmark Topic Watch Topic
  • New Topic

Format a double to 2 decimal places in struts html:text tag

 
Cory Max
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am trying to format a double value to two decimal places in a struts html:text tag. ex)

<html:text property="freight" size="9" maxlength="9"/>

the value inside freight is a double for example $100. When it displays, it shows it as 100.0, not 100.00 (like I want it to).

I would like to display all double values to two decimal places but the html:text does not have a format property.

Could someone please help?
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!