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: $decimalSeparator $thousandSeparator 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 fr

i18n\Formatter asDatetime()

asDatetime() public method Formats the value as a datetime. See also $datetimeFormat. public string asDatetime ( $value, $format = null )$value integer|string|DateTime The value to be formatted. The following types of value are supported: an integer representing a UNIX timestamp a string that can be parsed to create a DateTime object. The timestamp is assumed to be in $defaultTimeZone unless a time zone is explicitly given. a PHP DateTime object $format string The format used to conv

i18n\Formatter asDate()

asDate() public method Formats the value as a date. See also $dateFormat. public string asDate ( $value, $format = null )$value integer|string|DateTime The value to be formatted. The following types of value are supported: an integer representing a UNIX timestamp a string that can be parsed to create a DateTime object. The timestamp is assumed to be in $defaultTimeZone unless a time zone is explicitly given. a PHP DateTime object $format string The format used to convert the value in

i18n\Formatter asCurrency()

asCurrency() public method Formats the value as a currency number. This function does not require the PHP intl extension to be installed to work, but it is highly recommended to install it to get good formatting results. public string asCurrency ( $value, $currency = null, $options = [], $textOptions = [] )$value mixed The value to be formatted. $currency string The 3-letter ISO 4217 currency code indicating the currency to use. If null, $currencyCode will be used. $options array Opt

i18n\Formatter asBoolean()

asBoolean() public method Formats the value as a boolean. See also $booleanFormat. public string asBoolean ( $value )$value mixed The value to be formatted. return string The formatted result.

i18n\Formatter $timeZone

$timeZone public property The time zone to use for formatting time and date values. This can be any value that may be passed to date_default_timezone_set() e.g. UTC, Europe/Berlin or America/Chicago. Refer to the php manual for available time zones. If this property is not set, yii\base\Application::$timeZone will be used. Note that the default time zone for input data is assumed to be UTC by default if no time zone is included in the input date value. If you store your data in a different

i18n\Formatter $timeFormat

$timeFormat public property The default format string to be used to format a time. This can be "short", "medium", "long", or "full", which represents a preset format of different lengths. It can also be a custom format as specified in the ICU manual. Alternatively this can be a string prefixed with php: representing a format that can be recognized by the PHP date()-function. For example: 'HH:mm:ss' // time in ICU format 'php:H:i:s' // the same time in PHP format public string $timeFormat

i18n\Formatter $thousandSeparator

$thousandSeparator public property The character displayed as the thousands separator (also called grouping separator) character when formatting a number. If not set, the thousand separator corresponding to $locale will be used. If PHP intl extension is not available, the default value is ','. public string $thousandSeparator = null

i18n\Formatter $sizeFormatBase

$sizeFormatBase public property The base at which a kilobyte is calculated (1000 or 1024 bytes per kilobyte), used by asSize() and asShortSize(). Defaults to 1024. public integer $sizeFormatBase = 1024

i18n\Formatter $numberFormatterTextOptions

$numberFormatterTextOptions public property A list of name value pairs that are passed to the intl Numberformatter::setTextAttribute() method of all the number formatter objects created by createNumberFormatter(). This property takes only effect if the PHP intl extension is installed. Please refer to the PHP manual for the possible options. For example to change the minus sign for negative numbers you can configure this property like the following: [ NumberFormatter::NEGATIVE_PREFIX =&g