We currently display BigDecimal values in <s:textfield> tags in our jsps.
These values need to be formatted to display as currency values. Example:
"123.350000" should display as "123.35"
I extended the simple theme to create a currency theme using only the
text.ftl template file. I basically copied the text.ftl to
/template/currency and changed this line:
This does not work and gives a template error like
(WARNING: Parameters: Invalid chunk ignored.).
The extended theme by itself does work as this line works:
...which multiplies the bigdecimal value by 5 before displaying.
So can anyone let us know what is the best way to apply formatting in an
extended theme in a freemarker template? We also have some date values that
need formatting so will create another theme for that. I could add getText()
to each <s:textfield> tag explicitly but specifying a theme that handles the
formatting seems a lot cleaner. I have also tried freemarker formatting like
the one below with no success