cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : BigDecimal

Former Member
0 Kudos

Hi ,

Value is coming from RFC in 2 Decimals only. But I want to set this RFC value as 3 decimals in webdynpro.

For ex :

XYZ = 10024.35 (from RFC)

I want to set Value to be displayed on screen = 1002.435

Plz help me.Thanks in Advance.

Regards

Risha

Accepted Solutions (1)

Accepted Solutions (1)

former_member205363
Contributor
0 Kudos

Hi,

We have setScale method to set the decimals of BigDecimal in Java.

BigDecimal bigdec = new BigDecimal(10024.33);

BigDecimal b = bigdec.setScale(3,BigDecimal.ROUND_UP);

Here we have set the scale of BigDecimal, so b value is 10024.330

Add these steps to get 3 decimals in your code...........

Regards,

Lakshmi Prasad.

Answers (2)

Answers (2)

Former Member
0 Kudos

what is the type of the RFC output ? depending upon that we can divide that value by 10 and can display.

if this is not the requirement which you have then plz explain the scenario completely.

with regards

shanto aloor

Former Member
0 Kudos

Hi ,

Thanks for reply.

From RFC output is 10024.35 (this value is 2 decimals)

I want to set this value as 3 decimals like 1002.435

How to set this value as 3 decimals.

Thanks

Risha

Former Member
0 Kudos

Hi,

I think what you mean to say is:

if RFC output = 10024.35

display = 10024.350

Or should it be 1002.435?

Kindly clarify.

rgds,

Anagha

Former Member
0 Kudos

Hi,

Do you want the value to be displayed on screen as one tenth of the value coming from RFC?

After execution of the RFC, once the value is in ur context attribute, you may modify that particular context attribute before displaying.

Regards,

Anagha