2008年6月29日 星期日

OSC currencies precision

OSC uses decimal place in the admin/local setting to set the truncation.
The problem often occurs are truncation after multiplication or multiplication after truncation.
All product must be priced at one currency, typically USD.
An item purchase is calculated as truncation after multiplication (good). However, when multiple items are summed up, the final price is summed in USD and then translated into TWD.
The result is different with the summation of prices in TWD.

to avoid this, we need to align the precision of product. For example, if we set the decimal place to USD is 2, then at most we can set the decimal place of TWD to 2 and the currency exchange rate to be 31.12. Please do no set higher currency precision. The truncation will screw up the total calculation.

沒有留言: