JSP Two houses after the comma

1

I have the following number: 10.205203 I would like it to appear in only 10.02;

I have this function, I do not know if it's the right one

<fmt:formatNumber value="${media / total}" pattern="#,#0.0#" />

Thank you

    
asked by anonymous 31.10.2016 / 18:18

1 answer

1

You can use minFractionDigits and maxFractionDigits - reference .

<fmt:formatNumber minFractionDigits="2" maxFractionDigits="2" value="${media / total}"/>
    
31.10.2016 / 19:08