Loading...
 
 Error
  • Contact the site administrator. The index needs rebuilding.
Features / Usability

Features / Usability


How work Currency and Currency-convert (Mathematical calculation tracker field) ?

posts: 8633 Israel

Hello,

I see: https://doc.tiki.org/Calculations#Currency but documentation is too thin and seems it was created with a specific use-case in mind using a specific format. (seems it was made using https://www.bankofcanada.ca/rates/exchange/daily-exchange-rates/)

I need to know if it can do common currency conversion (like we can find in other web software)

I have a tracker with a product, field price = 10 and base price is in CAD

I have a tracker with currency rates (created from official published exchange rates - csv) it contains a currency exchange rate from the Bank of Canada.
IE For USD to CAD : 2021-04-26 | FXUSDCAD | 1.7241

So to display the product price in USD, I need a formula to take last updated date (today) take my base price and multiply it with the rate.

CAD_price = 10 * 1.7241 (and round it).

Does anyone knows if the currency or currency-exchange functions help doing this "simple" price conversion ?
(I made a prototype using a mathematical approach but it’s heavy if you go for a flexible solution with a lot of currencies)



Not sure it can end with a flexible solution for any country.
Other banks use a very different format to publish their rates exchange table
https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html
https://www.boi.org.il/en/Markets/ExchangeRates/Pages/Default.aspx
https://www.cnb.cz/en/financial-markets/foreign-exchange-market/central-bank-exchange-rate-fixing/central-bank-exchange-rate-fixing/

Russia and Japan use a PDF
... Or we need to find a free open (universal) source

There are no comments at this time.