Currently (2.3.27) ?string.currency
always means the default currency format provided by Java. So instead of changing that, you could define a custom format and use it like amount?string.@currency
(where currency
is just a name you have given to the format).
Custom formats are defined in Java. From the Manual (http://freemarker.org/docs/pgui_config_custom_formats.html#pgui_config_custom_formats_ex_alias):
// Where you initalize the application-wide Configuration singleton:
Configuration cfg = ...;
Map<String, TemplateNumberFormatFactory> customNumberFormats = new HashMap<>();
customNumberFormats.put("price",
new AliasTemplateNumberFormatFactory(",000.00"));
customNumberFormats.put("weight",
new AliasTemplateNumberFormatFactory("0.##;; roundingMode=halfUp"));
cfg.setCustomNumberFormats(customNumberFormats);
and then in the template:
${product.price?string.@price}
${product.weight?string.@weight}