You need to sign in to do that
Don't have an account?
V QR
Trigger Currency Conversion Display Wrong Decimal Places
Hi,
We have an object called "Project", and a project has its own currency, for instance ARS
There are 2 Number Fields that we use to get the conversion Rate between "Project Currency", EUR and $
Exchange USD - Number Field (10,8)
Exchange EUR - Number Field (10-8)
We have a Trigger, to get the conversion Rate.
And we have Set Currency Exchange to 6 Decimal Places
But on "Exchange USD" and "Exchange EUR", Number are rounded to 2 Decimals.
Does anyone know how to avoid the rounded decimal to 2?
We need to see 8 decimals, not rounded.
Thanks,
V
We have an object called "Project", and a project has its own currency, for instance ARS
There are 2 Number Fields that we use to get the conversion Rate between "Project Currency", EUR and $
Exchange USD - Number Field (10,8)
Exchange EUR - Number Field (10-8)
We have a Trigger, to get the conversion Rate.
And we have Set Currency Exchange to 6 Decimal Places
But on "Exchange USD" and "Exchange EUR", Number are rounded to 2 Decimals.
Does anyone know how to avoid the rounded decimal to 2?
We need to see 8 decimals, not rounded.
Thanks,
V
Please share the code where you are converting or doing calculation using these 2 fields..
Hi Sandeep,
The code is the trigger you can see in the screenshot.
I copy and paste below
trigger trigger_Before_Proyecto on Proyecto__c (before insert,before update) {
Proyecto__c proyecto = trigger.New[0];
CurrencyConversion conversor = new CurrencyConversion();
conversor.populateMap(proyecto.Fecha_Inicio__c);
proyecto.Cambio_EUR__c = conversor.convertCurrency('EUR',proyecto.CurrencyIsoCode,1);
proyecto.Cambio_USD__c = conversor.convertCurrency('USD',proyecto.CurrencyIsoCode,1);
}
It makes the calculation, but rounded to 2 decimals. And we need to see 8 decimal places.
Thanks,
V
I need a little help . I am almost there ... but need a little hand-holding. Agenda is to ALWAYS display the value converted in EUR - does not matter what the record currency is.
I am using this code below:
It is doing everything fine except the fact that the Amount_Converted__c field's values are displayed as USD (& EUR) but EUR seems like display only value - the USD is what the Amount_Converted__c field is holding. I want to use Amount_Converted__c converted in EUR in my workflow but instead I am getting the USD value - how could I just get the EUR value? I don't really need the Record Currency type - I need my EUR currency to be used in my workflows/approvals.
Please help.