‎2008 Nov 11 2:20 PM
Hi all,
I have a number displayed on form as 3 decimals and want to display this number as 2 decimals only.
How can I do that?
Thanks.
deniz.
‎2008 Nov 11 2:27 PM
Hi,
Display the field as &field(10.2)&
where 10 is length of field before decimals.
Regards
Manasa
‎2008 Nov 11 2:27 PM
Hi Deniz,
You need to manually define a Character variable in the driver program.
and in the sap script you need to use the PERFORM....END PERFORM and pass the decimal value and do the changes in the subroutine and pass the 2 decimal data to the variable which you have declared and passed the perform and subroutine.
Now displya the character variable which is returing you the 2 decimal value.
Thanks,
Chidanand
‎2008 Nov 11 2:27 PM
Hi,
Display the field as &field(10.2)&
where 10 is length of field before decimals.
Regards
Manasa
‎2008 Nov 11 2:29 PM
hi you can use some thing like this :
&p_NTGEW(10)& only the 10 characters will be visible length
or in the print program find out the filed
data: p_ntgew type p decimal 3. change it to
VVVVVV
data: p_ntgew type p decimal 2.
‎2008 Nov 11 2:30 PM
Hi,
use (.2) as a prefix after the Variable to display upto 2 decimal places.
For eg: &net_price(.2)& will be used to print the net price value till two places of decimal.
as a general rule (.n) will be used as a prefix after the variable to display upto n decimal places, where n=0 , for no decimal places.
‎2008 Nov 11 2:36 PM
Ok.. I got to raise this
think the value is 218.509
525.589
528.893
total : 1272.991.
and we show 218.50
525.58
528.89
total: 1272.97