i18n\Formatter asDecimal()

asDecimal() public method

Formats the value as a decimal number.

Property $decimalSeparator will be used to represent the decimal point. The value is rounded automatically to the defined decimal digits.

See also:

public string asDecimal ( $value, $decimals = null, $options = [], $textOptions = [] )
$value mixed

The value to be formatted.

$decimals integer

The number of digits after the decimal point. If not given the number of digits is determined from the $locale and if the PHP intl extension is not available defaults to 2.

$options array

Optional configuration for the number formatter. This parameter will be merged with $numberFormatterOptions.

$textOptions array

Optional configuration for the number formatter. This parameter will be merged with $numberFormatterTextOptions.

return string

The formatted result.

throws yii\base\InvalidParamException

if the input value is not numeric or the formatting failed.

doc_Yii
2016-10-30 17:05:57
Comments
Leave a Comment

Please login to continue.