News:

Looking for documentation? Take a look on our wiki

Main Menu

price round on 1 digit, but want show 0 on end

Started by itsyours, August 10, 2014, 22:41:46 PM

Previous topic - Next topic

itsyours

Hi I have product, with "Final salesprice" 3,88
- i want to round it to 3,9€ but want to display as 3,90€

- I try set in configuration->pricing-> set +1 in Final salesprice, but if i look on product there is 3,9€ instaed of 3,90€

please..I look on the forum, but find nothing...please help meeeeee

itsyours

I try to coding something like this:
$a=$this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices);

  $b=str_replace(',', '.',"$a");
  $p=preg_replace("/[^0-9\.]/", "", $b);
  $o=str_replace(',', '.',"$p");
  $f = sprintf ("%.2f", $p);
?><div class="PricesalesPrice"><span class="PricesalesPrice"><?php echo (str_replace('.'',',"$f")).'€';?></span></div>


it looks like that work...I hope......or??? have other or lightweight solution?
please look at my solution MILBO or other developer