V
V
vbNoName2018-05-14 22:20:29
Java
vbNoName, 2018-05-14 22:20:29

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;
    }

Here, the value is replaced by signature using the freemarker template engine. But the problem is that if a digit is substituted in some place, it is substituted in the format 12.345. That is, the thousandth part is separated by a comma at the output. Is it possible to do something so that this does not happen? That is, 12345 was displayed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
al_gon, 2018-05-14
@vbNoName

${n?c}
PS: n=12345

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question