i18n\Formatter asPercent()

asPercent() public method

Formats the value as a percent number with "%" sign.

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

The value to be formatted. It must be a factor e.g. 0.75 will result in 75%.

$decimals integer

The number of digits after the decimal point.

$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:06:00
Comments
Leave a Comment

Please login to continue.