2015-04-06 127 views
1

为了正确地在Magento的滑块显示,我们的价格我使用这行:显示价格PHP

<?php $first_amount_before_split = number_format($this->helper('tax')->getPrice($_product, $_product->getFinalPrice()), '2', '.', ','); $my_array = explode(".", $first_amount_before_split);?> 

而且我赞同该行以:<span class="main-price"><?php echo $my_array[0]; ?>,-</span>

但价格高于1000的显示为:1100, - 并且我想将此显示为1.100, -

所以我想更改符号,

我该如何做到这一点?

回答

1

你想看看数字格式来实现:

http://php.net/manual/en/function.number-format.php

+0

谢谢我知道,但我目前已经在使用该行。那么,我该如何修改当前的代码呢? –

+0

将您的最后一个逗号更改为。 – MrTechie

+0

我试过了,但是dat没有工作。 1.000的价格 - 显示为1, - –