1

To display our prices correctly in a slider on Magento I use this line:

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

And I echo that line with: <span class="main-price"><?php echo $my_array[0]; ?>,-</span>

But prices above 1000 are displayed as: 1,100,- and I want to display this as 1.100,-

So I would like to change the symbol , for a .

How can I achieve that?

JGeer
  • 1,768
  • 1
  • 31
  • 75

2 Answers2

1

You want to check out number format to accomplish this:

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

MrTechie
  • 1,797
  • 4
  • 20
  • 36
0

Assuming this is a localization related thing you are trying to achieve, you should probably use Magento’s built-in localization methods for displaying prices.

Community
  • 1
  • 1
fantasticrice
  • 1,631
  • 1
  • 21
  • 31