|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
A class used to format currencies. More...
Inheritance diagram for Erebot\Styling\Variables\CurrencyVariable:Public Member Functions | |
| __construct ($value, $currency=null) | |
| getCurrency () | |
| getValue () | |
| render (\Erebot\IntlInterface $translator) | |
Protected Attributes | |
| $currency | |
| Currency the amount is expressed in. | |
| $value | |
| Amount. | |
A class used to format currencies.
Definition at line 27 of file CurrencyVariable.php.
| Erebot\Styling\Variables\CurrencyVariable::__construct | ( | $value, | |
$currency = null |
|||
| ) |
Constructor.
| float | $value | An amount of some currency to format. |
| string | null | $currency | (optional) The currency the amount is expressed in. This is used to pick the right monetary symbol and conventions to format the amount. The default is to use the currency associated with the translator given during the actual formatting operation. |
Definition at line 49 of file CurrencyVariable.php.
References Erebot\Styling\Variables\CurrencyVariable\$currency, and Erebot\Styling\Variables\CurrencyVariable\$value.
| Erebot\Styling\Variables\CurrencyVariable::getCurrency | ( | ) |
Returns the currency the amount is expressed in.
| string | The name of the currency used to express the amount. |
| NULL | NULL is returned in case no currency was given at construction, meaning that the currency will automatically be selected at runtime. |
Implements Erebot\Styling\Variables\CurrencyInterface.
Definition at line 78 of file CurrencyVariable.php.
References Erebot\Styling\Variables\CurrencyVariable\$currency.
| Erebot\Styling\Variables\CurrencyVariable::getValue | ( | ) |
Returns the value stored in this object.
| mixed | Value stored in this object. |
Implements Erebot\Styling\VariableInterface.
Definition at line 73 of file CurrencyVariable.php.
References Erebot\Styling\Variables\CurrencyVariable\$value.
| Erebot\Styling\Variables\CurrencyVariable::render | ( | \Erebot\IntlInterface | $translator | ) |
Renders the content of this variable.
| Erebot::IntlInterface | $translator | A translator that can be used to change the rendering depending on the target locale. |
| string | The variable rendered as a string. |
Implements Erebot\Styling\VariableInterface.
Definition at line 63 of file CurrencyVariable.php.
References Erebot\Styling\Variables\CurrencyVariable\$currency, and Erebot\IntlInterface\LC_MONETARY.