Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9159

Re: problem with decimals

$
0
0

Hi Ahmed,

 

As several SCN users have pointed out already, your formula seems to be working fine. I just tried your sample too and that returned the same results of 186,67.

 

If you want a higher accuracy, you could use an intermediate variable for the calculations and then round to your requirement of 2 decimals.

 

For example, declare a variable of type decfloat16 or decfloat34 (or even type f):

DATA: lv_temp TYPE decfloat16.

 

lv_temp = ( kwert / 30 ) * 14.

 

then move this value to your field AMNT.

 

 

Best to use higher accuracy variables when you do the calculations and move the result to your required format afterwards.

 

Best regards,

Zhou


Viewing all articles
Browse latest Browse all 9159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>