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

price number format

Started by D_L_I, August 31, 2014, 10:56:48 AM

Previous topic - Next topic

D_L_I

Hey guys,
looking for a way to get the prices to be rounded to 1 digit after decimal point, but display 2.
meaning the price 10.72 should be displayed as 10.70.
If I am sending rounding digits to 1 it displays only 10.7, and I need the last 0 to be displayed as well.

Thanks!!

jjk

I didn't test this myself, but basically two options to play with come into my mind:
1. Different combinations of 'Currencies' >your currency > Decimals / Configuration > Pricing tab> Rounding Digits.
2. Enable "Use for swizz CHF the Rappenrundung" in Configuration > Pricing tab and create a template override file of ...\administrator\components\com_virtuemart\helpers\currencydisplay.php, in which you change the 'numeric_code' to the one of your currency and the 0.5 in the next line to 1.0.
if($this->_numeric_code===756 and VmConfig::get('rappenrundung',FALSE)=="1"){
$price = round((float)$price * 2,1) * 0.5;
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

or you format your currency,. use rounding 1 and just add a 0
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

D_L_I

thanks Milbo and jjk...
did not know about formatting the currency  :)

loppan

Quote from: Milbo on August 31, 2014, 19:30:01 PM
or you format your currency,. use rounding 1 and just add a 0
Thanks Milbo, that's a great tip, but I'm having one issue, and I'm wondering if I'm doing something wrong.

My base currency is SEK but I want EUR to show for example 18.10 € instead of 18.13 €.

In Configuration / Pricing I use rounding 1 on all displayed prices. This makes all prices show 18.1 € instead of 18.13 €.

I then add a "0" in Configuration / Currencies : Positive format : {number}0 {symbol}. Now the product price show as 18.10 €. Great!

But my cart module still shows the price with the default rounding, an on top of this it adds the 0, please see the attached screenshot :

How can I make the cart display also show 18.10 instead of 18.130?

Checkout looks fine, it's just the cart module that's giving me problems. Is this a bug?

Best

Peter