VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: bluesheep on February 11, 2012, 12:37:08 PM

Title: Solution for user's in Switzerland (0.05 rounding)
Post by: bluesheep on February 11, 2012, 12:37:08 PM
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
Title: Re: Solution for user's in Switzerland (0.05 rounding)
Post by: Milbo on October 02, 2012, 12:49:23 PM
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