Format numbers in templates