News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to remove nonsignificant zeroes in product prices in Virtuemart frontend?

Started by borro, May 30, 2014, 10:40:13 AM

Previous topic - Next topic

borro

Hello

I need to remove nonsignificant zeroes(decimal places, the figures after decimal point) in currency displaying at frontend.
I made the hack in \administrator\components\com_virtuemart\helpers\currencydisplay.php
I removed this code:
$res = number_format((float)$nb,(int)$nbDecimal,$this->_decimal,$this->_thousands);
with this one:
$res = (string)$nb;

Is my decision correct?
Tested in VM 2.6.1
Wish you happiness!

Maxim Pishnyak

You could use preg_replace in your template overrides and your fix will be able to resist next VM update. No hack, please.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart