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 up error.

Former Member
0 Likes
825

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
Read only

Former Member
0 Likes
761

Hi,

declare ur price varaible as

data: kbetr type p decimals 5.

Regards

5 REPLIES 5
Read only

Former Member
0 Likes
761

declare your variable as type p decimals 5.

Read only

Former Member
0 Likes
761

hi ,

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

regards,

venkat.

Read only

Former Member
0 Likes
762

Hi,

declare ur price varaible as

data: kbetr type p decimals 5.

Regards

Read only

Former Member
0 Likes
761

Thanks 2 all

full points to u all my issue has been resolved.

Regards,

Ronak

Read only

rahul2000
Contributor
0 Likes
761

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