CakePHP 1.2 Number Helper - Currency method format to GDP £
-
05-06-2021 - |
Question
How Do I format this code to display a Great British Pound Currency (£) sign but only next to the $item['total']?
<?php echo $id; ?>Total"><?php echo $number->currency (isset($item['total']) ?
$item['total'] : $item['quantity'] * $item['price']); ?>
I can't seem to get the syntax right.
This attempt did not work:
<?php echo $id; ?>Total"><?php echo $number->currency (isset($item['total'], 'GDP') ?
$item['total'] : $item['quantity'] * $item['price']); ?>
The documentation is here: http://api12.cakephp.org/class/number-helper#method-NumberHelpercurrency
Solution
try this:
<?php echo $number->currency ((isset($item['total']) ? $item['total'] : $item['quantity'] * $item['price']),'GBP'); ?>
Hope this helps
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow