JSP Two boxes after the comma

Asked

Viewed 71 times

1

I have the following number: 10.205203 I would like it to be shown at only 10.02;

I have that function, I don’t know if it’s the right one

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

Thanks

1 answer

1


Can use minFractionDigits and maxFractionDigits - reference.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.