CakePHP 1.2号码助手 - 货币法格式对GDP£

时间:2012-05-02 15:17:05

标签: cakephp cakephp-1.2

如何设置此代码的格式以显示英镑(£)标志,但只在$ item ['total']旁边?

<?php echo $id; ?>Total"><?php echo $number->currency (isset($item['total']) ? 
$item['total'] : $item['quantity'] * $item['price']); ?>

我似乎无法正确理解语法。

这种尝试不起作用:

<?php echo $id; ?>Total"><?php echo $number->currency (isset($item['total'], 'GDP') ? 
$item['total'] : $item['quantity'] * $item['price']); ?>

文档在这里: http://api12.cakephp.org/class/number-helper#method-NumberHelpercurrency

1 个答案:

答案 0 :(得分:0)

试试这个:

<?php echo $number->currency ((isset($item['total']) ? $item['total'] : $item['quantity'] * $item['price']),'GBP'); ?>

希望这有帮助

相关问题