interface FormatterInterface (View source)

An interface for formatters.

Methods

string
format(mixed $value, Locale $locale, array $styleProperties = [])

Formats provided value using optional style properties

Details

string format(mixed $value, Locale $locale, array $styleProperties = [])

Formats provided value using optional style properties

Parameters

mixed $value

Formatter-specific variable to format (can be integer, \DateTime, etc)

Locale $locale

Locale to use

array $styleProperties

Integer-indexed array of formatter-specific style properties (can be empty)

Return Value

string

String representation of $value provided, or (string)$value