Kwakkelflap: tools for the IT pro

Tuesday, November 27, 2007

Currency rounding

I've talked about automatic currency conversion a while ago. Right now I'm using a home made script that uses the Plimus system to display the price in the users currency if this is different than the default currency.

The automatic conversion is nice, but it's even better if the converted number is rounded to a sensible amount. Right now, I use a rounding to 50 cents. And this is where I have a problem.

I sell my software in euros in nice round numbers. But now and then the rounding and the currency script combination act in strange ways:



As you can see, 55 euros was rounded to 55.50 euros. There is no need for rounding but Plimus does it anyway. And of course 55 euros is not equal to 55.50 euros so the conversion is displayed on my webpage. The amount is 55 euros when ordering though, so there is no error in the conversion there.

I suspect that there is a conversion from euro to dollars and then back to euros when using the script. This might result in a conversion error depending on the (daily adjusted) conversion rate.

Plimus is having problems in locating this bug so I've disabled price rounding again for the time being.

Labels:

0 Comments:

Post a Comment

<< Home