java - Setting default fmt formatNumber maxFractionDigits for all jsp pages -
is possible have following tag display 5 decimal places?
<fmt:formatnumber type="currency" value="${number}" />
without having change to
<fmt:formatnumber type="currency" maxfractiondigits="5" value="${number}" />
basically have many of these , want them change, want 5 decimal places default.
yes. cam implement extending fmt:formatnumber
functionality.
for this, create class extending org.apache.taglibs.standard.tag.rt.fmt.formatnumbertag
set maxfractiondigits 5 default (when not supplied).
you need change reference in fmt tag library descriptor (tld) file point own implementation.
these should present in jstl jar located in web-inf\lib
default .
edit: personally, go adeel's approach of setting custom locale, if @ possible.
Comments
Post a Comment