tags:

views:

16

answers:

1

hi from my db i am getting a value as string type and when i am displaying in in my jsf page it is displaying as 12.0 but i want to display it as 12.00

can i do that by changing the data type from string to double or any other ways can any one please suggest me?

thanks Suresh

+1  A: 

You can use the <f:convertNumber/> component for that.

Here is how it works to have 2 digits for the fraction part of your number:

<h:outputText value="#{myBean.myValue}">
    <f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
</h:outputText>
romaintaz