Suggestion #9077
format.numberChoice
Status: | New | Start date: | 2010-07-29 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | - | |||
Target version: | - | |||
Has patch: | Tags: |
Description
This ViewHelper is a port of Symfony's format_number_choice()
helper.
You can use it to render different strings depending on a given number. In the simplest of cases it can be used to have correct singulars and plurals. It also works well with localized strings.
Example:
<f:format.numberChoice number="42" arguments="{number:42}">[0] no eggs|[1] 1 egg|[2,+Inf] ###number### eggs</f:format.numberChoice>
will output
42 eggs