News:

Support the VirtueMart project and become a member

Main Menu

Solution for user's in Switzerland (0.05 rounding)

Started by bluesheep, February 11, 2012, 12:37:08 PM

Previous topic - Next topic

bluesheep

Hello at all

I use VM 2.0.0F in switzerland. In switzerland we have not 1 Rappen (Rappen = Cent). The lowest coin is 5 Rappen. We also need to round to 0.05.

I have make this so:
In administrator/component/com_virtuemart/helper/calculationh.php on line 1043 i changed the code from

function roundDisplay($value) {
if($this->_currencyDisplay->_vendorCurrency == 27)
{
return round($value, 2);
}

in

function roundDisplay($value) {
if($this->_currencyDisplay->_vendorCurrency == 27)
{
return round($value*2, 1)/2;
}
else
{
return round($value, 2);
}
}

For our project, thats works fine.

Is there a way, fore another release to implement a option like "Round in 0.05"?

Beste GrĂ¼sse
bluesheep

Milbo

Hi

I think your hack is still valid or at least almost. We have anyway also a rounding per currency which is imho more important then the one in the main config.

I think it is correct just to overwrite it for the currency. My question is now if we should use the vm id, the currency country code, or the one 3 digit code of the banks. I think the best is the numeric code
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/