Get variable value to four decimal places

Hi All,

I need to calculate currency exchange rate from currency factor of sales header.

CurrExchRate := 1/Currency Factor;

I need to get CurrExchRate variable with four decimal places. But it doesn’t come. it alway round up to one decimal placs.

then I used round function as follows.

CurrExchRate := ROUND((1/Currency Factor),0.0001,’>’);

But same problem existing.

Hi Hansi,

I am not sure how you are checking the value but some analytical steps might help you to zero in the problem.

  1. Display the value of ROUND((1/Currency Factor),0.0001,’>’) directly into a message and see whether the desired result is being displayed or not.

  2. If you viewing the value of CurrExchRate in a TextBox then check the property DecimalPlaces of that textbox.

  3. Display the value of 1/Currency factor directly into the message and see whether the value has more than one decimal place or not.

/Anup

Hi Anup,

I tried it now. But it is not working. same problem.

More information would be required to do analysis. However did you try all the steps I mentioned ? Can you update the details like currency factor value and the result getting displayed in each of the steps mentioned ?

Hi,

You should check the display length property of the extended Data Type oy your variable CurrExchRate, see also the display properties of your field

Hope it helps

Regards,

Thomas

Hi Thomas,

Data type of ‘CurrExchRate’ variable is decimal. How can i access its properties. when i go properties window it shows only ‘ID’ and ‘Dimension’ Properties.

Hi Anup,

I tried all the steps u mentioned.

Currency factor = 0.009115770282589

(1/Currency factor) show the result of 109.7. I need the result with four decimal places.