I have moved this over from "bugs" to "feature requests".

Currently FreeMarker doesn't support setting a number format that's not defined by DecimalFormat. This limitation is known to be a problem, and addressing this is quite high on the TODO list, but I don't dare to tell a date when this will be fixed. Until that, what you can do is defining a TemplateMethodModelEx, put that into the data-model or into the Configuration as shared variable (or into an #import like <#assign myFormat = 'com.example.MyFormat'?new()>) and then format the numbers like ${myFormat(x)}.