Answer the question
In order to leave comments, you need to log in
How to format freemarker numbers?
There is such a code
private String replace(String template, Map<String, Object> model) {
Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
cfg.setObjectWrapper(new DefaultObjectWrapper(Configuration.VERSION_2_3_0));
Template t;
try {
t = new Template("templateName", new StringReader(template), cfg);
Writer out = new StringWriter();
t.process(model, out);
return out.toString();
} catch (IOException | TemplateException ex) {
log.error("", ex);
}
return null;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question