PHP Class Neos\FluidAdaptor\ViewHelpers\Format\NumberViewHelper

See also: http://www.php.net/manual/en/function.number-format.php = Examples = 423423.234 423,423.20 423423.234 423.423,2 {someNumber -> f:format.number(forceLocale: true)} 54.321,00 (depending on the value of {someNumber} and the current locale) {someNumber -> f:format.currency(forceLocale: 'de_DE')} 54.321,00 (depending on the value of {someNumber})
Inheritance: extends Neos\FluidAdaptor\Core\ViewHelper\AbstractLocaleAwareViewHelper
显示文件 Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$numberFormatter Neos\Flow\I18n\Formatter\NumberFormatter

Public Methods

Method Description
render ( integer $decimals = 2, string $decimalSeparator = '.', string $thousandsSeparator = ',', string $localeFormatLength = NumbersReader::FORMAT_LENGTH_DEFAULT ) : string Format the numeric value as a number with grouped thousands, decimal point and precision.

Method Details

render() public method

Format the numeric value as a number with grouped thousands, decimal point and precision.
public render ( integer $decimals = 2, string $decimalSeparator = '.', string $thousandsSeparator = ',', string $localeFormatLength = NumbersReader::FORMAT_LENGTH_DEFAULT ) : string
$decimals integer The number of digits after the decimal point
$decimalSeparator string The decimal point character
$thousandsSeparator string The character for grouping the thousand digits
$localeFormatLength string Format length if locale set in $forceLocale. Must be one of Neos\Flow\I18n\Cldr\Reader\NumbersReader::FORMAT_LENGTH_*'s constants.
return string The formatted number

Property Details

$numberFormatter protected_oe property

protected NumberFormatter,Neos\Flow\I18n\Formatter $numberFormatter
return Neos\Flow\I18n\Formatter\NumberFormatter