I’d like to have a BigDecimal formatted with 2 decimals after the decimal point. Always.
Based on some boolean checks, I sometimes return a BigDecimal.ZERO;
In this case, the JSF page just displays “0”, although I set <f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>.
I do not understand this, but nevertheless how can I enforce 2 digits else?
there are 2 ways of doing this
you can use the built in
BigDecimalfunctionThis returns a big decmial with 2 digits past the decimal and also rounds up.(there are also other rounding methods)
OR
you could use jsf convertNumber Tag