|
Nilesh, Create a file for the currency exchange rates. The file would have two fields of Currency (primary unique key which appears to be 3A in your case) and the exchange rate. To convert from one currency to another you calculate a currency exchange rate from the two currencies' Dollar exchange rates. To calculate the two currencies exchange rate chain to the file for both currencies to retrieve both exchange rates. The exchange rate between the two currencies is the To Currency Exchange Rate divided by the From Currency Exchange Rate. Use the calculated exchange rate between the two currencies to do the conversion. An example with just currency units Yen exchange rate is (Yen / Dollar). To convert Yen to Dollars you divide the Yen by the exchange rate to get Dollars: Yen / (Yen / Dollar) = Dollar Won exchange rate is (Won / Dollar). To convert Won to Dollars you divide the Won by the exchange rate to get Dollars: Won / (Won / Dollar ) = Dollar To convert Yen to Won you calculate the Yen to Won exchange rate. The Yen to Won exchange rate is the Yen exchange rate divided by the Won exchange rate: (Yen / Dollar) / (Won / Dollar) = (Yen / Won) To convert Yen to Won you divide the Yen by the exchange rate: Yen /((Yen / Dollar) / (Won / Dollar)) = Yen / (Yen / Won) = Won. Paul -- Paul Morgan Senior Programmer Analyst - Retail J. Jill Group 100 Birch Pond Drive, PO Box 2009 Tilton, NH 03276-2009 Phone: (603) 266-2117 Fax: (603) 266-2333 "Butala, Nilesh" <NButala@xxxxxxxxxxxxxxx> wrote in message news:7B448EABE941D34D8648522FD07AA6391375CD@xxxxxxxxxxxxxxx > Currently we are receiving Currency exchange rates from Bank against USD > (US$). We have Companies in UK and Mexico, Germany, Etc. I am trying to > convert rates from Japan (JPY) to (EUR) Euro, EUR to GBP, JPY to GBP etc. > > If some one has written a code and like to share with me or point me to > right direction. > > Thanks > > Nilesh > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.