#### Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

# Currency conversion

Member Posts: 446
edited 2007-08-14
Hi Experts,
I have a field call grant total in report which is defined in C/AL globals as decimal and is use to calculate Grand total for totals. How do you convert this field values which is in foreign currency to a local currency?

Thanks.

• Member Posts: 509
What exchange rate do you want to use as at today?
Assuming your report has a group total by "Currency Code"

Hint:
Look at the code on the Sales Line table search for FCYtoLCY

David
Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: [email protected]
• Member Posts: 446
I am using 30.00 for a test.
The variable is not a standard field in the table. I defined it to take the results of the calculated total for the totals of certain amounts. this value is in foreign currency USD and i want to convert the equivalent to LCY.
I have not seen FCYtoLCY in the sales line table.
can you please tell me what i should do to get the equivalence in LCY Please!!!
Thanks.
• Member Posts: 509
The "Currency Exchange Rate" tables has currency functions for
LCY to FCY
FCY to LCY
FCY to FCY

Currency = Record = Currency
CurrExchRate = Record = Currency Exchange Rate
AmountLCY = Decimal
AmountFCY = Decimal

You also need a "Currency Code"
This function will return the currency factor
CurrExchRate.ExchangeRate(WORKDATE,"Currency Code")
```//Sets the Defaults
Currency.InitRoundingPrecision;
IF "Currency Code" <> '' THEN
AmountLCY :=
ROUND(
CurrExchRate.ExchangeAmtFCYToLCY(
WORKDATE,"Currency Code",
AmountFCY,CurrExchRate.ExchangeRate(WORKDATE,"Currency Code")),
Currency."Amount Rounding Precision")
ELSE
AmountLCY :=
ROUND(AmountFCY,Currency."Amount Rounding Precision");
```

David
Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: [email protected]