fix freemarker number formatting bugs