cancel
Showing results for 
Search instead for 
Did you mean: 

Round of Value after 3 decimal places

Former Member
0 Kudos

Hi Experts,

     I have a requirement in which i need to round of the value after 3 decimal places.

For e.g. I have 2 inputs X and Y.

X/Y gaves a value .....lets say  its 12348.896975553

Than i want my output to be like 12348.897 (values rounded up till 3 decimal places)

Can you please suggest how to achieve this?

Can this be handled through mapping or we need to write a UDF for this.

Regards,

CB

Accepted Solutions (1)

Accepted Solutions (1)

umesh_badveli
Participant
0 Kudos

Hi Chandra ,

Formate Number also Rounding the values up to 3 decimals.

See this Example it may be useful for you

For two different input

1)12348.896975553 your  value

2)12348.896175553

Thanks

Umesh

Answers (3)

Answers (3)

former_member653066
Participant
0 Kudos

hi dear,

simply you can pass that value to packed decimal data type..

have a look below sample programme.

DATA: N1 TYPE P DECIMALS 9 VALUE '12348.896975553',

            N2 TYPE P DECIMALS 3.

MOVE N1 TO N2.

WRITE: N2.


output :     12,348.897


hope it is help full.

BR.

umesh_badveli
Participant
0 Kudos

Hi Chandra,

You can use Formate Function .See below Screenshot

Thanks

Umesh Reddy

former_member186851
Active Contributor
0 Kudos

Hello Chandrabhan,

Use Format function

Input----> Format Function(00000.000)---> Output.

Former Member
0 Kudos

Hi Raghuraman,

     I understand the fornat number will keep the Decimal format.

But it wound round of after three Decimal places..

Please see the example i have given .... the value need to be populated in the same manner.

former_member186851
Active Contributor
0 Kudos

Hello Chandra,

Guess it will round off as well.

Please try, if its not working let me know.