I am using StringTemplate in Java.
I would like to render decimal number with a certain precision (e.g. 3 digits after the decimal point).
Is it possible to for the ST object to do it? And how?
Edit: to clarify, this is especially relevant when rendering objects. E.g. my code looks like
String renderMe(String template, Collection<MyClass> items)
{
// render the items here using the template....
}
renderMe() doesn't have to know anything about the fields of MyClass, in particular it doesn't have to know which fields are floating points. I am looking for a solution that maintains this decoupling.