TYPO3 Flow Base DistributionPackagesApplications

Suggestion #9077

format.numberChoice

Added by Christian Zenker almost 3 years ago. Updated over 2 years ago.

Status:New Start date:2010-07-29
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Has patch: Tags:
Votes: 0

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

Also available in: Atom PDF