currency
currency(mixed $number, string $currency= 'USD')
This method is used to display a number in common currency formats (EUR,GBP,USD). Usage in a view looks like:
Простой текст<?php echo $number->currency($number,$currency); ?>
The first parameter, $number, should be a floating point number that represents the amount of money you are expressing. The second parameter is used to choose a predefined currency formatting scheme:
| $currency | 1234.56, formatted by currency type |
|---|---|
| EUR | ? 1.236,33 |
| GBP | ? 1,236.33 |
| USD | $ 1,236.33 |
HTML entities are outputted as currency symbols where needed.
If a non-recognized $currency value is supplied, it is prepended to a USD formatted number. For example:
Простой текст<?php echo $number->currency('1234.56', 'FOO'); ?>//Outputs:FOO 1,234.56


Коментарии:
Добавить коментарий