Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ROUND Fn Module

Former Member
0 Likes
565

Hi All,

I have a Field which have the Expected values like 0.29846.

I want this field to be Rounded to Four Digits using ROUND Fn Module.

Help me out.... Points will be rewarded immediately.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
546
report ychatest message-id zz..

data : orig_amt type p decimals 10 value '0.29846',
       round_amt type p decimals 4.


call function 'ROUND'
  exporting
    decimals      = 4
    input         = orig_amt
    sign          = '-'
  importing
    output        = round_amt
  exceptions
    input_invalid = 1
    overflow      = 2
    type_invalid  = 3
    others        = 4.

write : round_amt.
report ychatest message-id zz..

data : orig_amt type p decimals 10 value '0.29846',
       round_amt type p decimals 4.


call function 'ROUND'
  exporting
    decimals      = 4
    input         = orig_amt
    sign          = '-'
  importing
    output        = round_amt
  exceptions
    input_invalid = 1
    overflow      = 2
    type_invalid  = 3
    others        = 4.

write : round_amt.
3 REPLIES 3
Read only

Former Member
0 Likes
546

Hi

Instead of fun module

try with the following Function commands

<b>abs</b> -Absolute value of the argument arg

<b>sign</b>- Plus/minus sign of the argument arg: -1, if the value of arg is negative; 0 if the value of arg is 0; 1 if the value of arg is positive.

<b>ceil</b> -Smallest integer number that is not smaller than the value of the argument arg.

<b>floor-</b> Largest integer number that is not larger than the value of the argument arg.

<b>trunc-</b> Value of the integer part of the argument arg

<b>frac-</b> Value of the decimal places of the argument arg

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
547
report ychatest message-id zz..

data : orig_amt type p decimals 10 value '0.29846',
       round_amt type p decimals 4.


call function 'ROUND'
  exporting
    decimals      = 4
    input         = orig_amt
    sign          = '-'
  importing
    output        = round_amt
  exceptions
    input_invalid = 1
    overflow      = 2
    type_invalid  = 3
    others        = 4.

write : round_amt.
Read only

Former Member
0 Likes
546

Thanks for all who responded