Application Development 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: 

Round up error.

Former Member
0 Kudos

Dear All,

I have a issue in which i am calculating VAT by a particular logic now when i am dividing the values for VAT calculation

for larger values the number of digits after decimal point is proving critical resulting into answer which is different than the actual one by some value.

The simple way by which i can explain is for value say,

35756.25 / 5000.000 the actual value is 7.15125

but since i have declared that variable of type

ZSDSTR003-KBETR it is truncating digits from 3 onwards after decimal point and

value is maintained as 7.15 and not 7.15125 which is causing my final answer to vary by a small amount.

Thanks 2 all

Ronak.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

declare ur price varaible as

data: kbetr type p decimals 5.

Regards

5 REPLIES 5

Former Member
0 Kudos

declare your variable as type p decimals 5.

Former Member
0 Kudos

hi ,

use the field KBETR type p decimals 5 in the ztable..

regards,

venkat.

Former Member
0 Kudos

Hi,

declare ur price varaible as

data: kbetr type p decimals 5.

Regards

Former Member
0 Kudos

Thanks 2 all

full points to u all my issue has been resolved.

Regards,

Ronak

rahul2000
Contributor
0 Kudos

Dear Kabani,

Declare a variable of type P decimals 5..

DATA:VAR TYPE P DECIMALS 5

and take the value in that variable

Reward if it helps