money icon indicating copy to clipboard operation
money copied to clipboard

CachedCurrencyConverter - is it wise to store conversion rate for 1?

Open zpbappi opened this issue 8 years ago • 0 comments

I am actually storing 1 unit of source currency's equivalent amount in the destination currency in the current implementation.

I was just thinking about truncation that the currency providing services does. So, if we convert from a really low-value currency to a high-value currency (say, ZWD to GPB) and store the rate for 1 ZWD only, we may face some notable difference when trying to convert a large amount of ZWD. Just to give you an idea, currently 1 ZWD = 0.00194643 GBP (according to xe.com) and it does not change if I try to convert 1000 or even 100,000. I am not sure that all other currency pairs will be same. Will there be any truncation for a smaller amount?

So, If there is any truncation at all, I was thinking more like storing 100 or 1000 units of source currency to destination currency conversion rate to reduce the effect. Comments from who are experienced in this field will be much appreciated.

zpbappi avatar Mar 10 '16 04:03 zpbappi