double it.error=1 ,int it.d=2
<h:outputText value="#{it.error}">
<f:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
</h:outputText>
displays 1.00
but
<h:outputText value="#{it.error}">
<f:convertNumber maxFractionDigits="#{it.d}" minFractionDigits="#{it.d}"/>
</h:outputText>
displays 1
Using tomcat 6.0.29 and mojarra 2.1.4
That can happen if the
<h:outputText>is inside a<h:dataTable>and thus#{it}is not available in the scope when the view is been built (but only when the view is been rendered). The tag handlers like<f:xxx>are only created/evaluated when the view is been built.There are several ways to workaround this problem, all which are outlined in the following answer: How to set converter properties for each row of a datatable?