Conforms to GRMustacheFilter
GRMustacheRendering
GRMustacheTagDelegate
Declared in NSFormatter+GRMustache.h

Overview

A category on NSFormatter that allows them to be directly used in GRMustache templates.

Companion guide: https://github.com/groue/GRMustache/blob/master/Guides/NSFormatter.md

All NSFormatter subclasses such as NSDateFormatter, NSNumberFormatter, and your custom subclasses are concerned.

Filter facet

A formatter can be used as a filter, as in {{ percent(value) }}. Just have your percent key evaluate to a formatter.

Formatting all values in a section

A formatter can be used to format all values in a section of a template:

{{# percent }}...{{ value1 }}...{{ value2 }}...{{/ percent }}

The formatting then applies to all inner variable tags that evaluate to a value that can be processed by the filter (see [NSFormatter stringForObjectValue:] documentation).

Inner loops and boolean sections are unaffected. However their inner variable tags are:

{{# percent }}
  {{ value1 }}      {{! format applies }}
  {{# condition }}  {{! format does not apply }}
    {{ value2 }}    {{! format applies }}
  {{/ condition }}
{{/ percent }}