on 05-22-2007 10:04 PM
I have a quantity field with three decimal places. I have to print this field with only one decimal place. This is in a smartform.
suppose: qty = 45.678
I want it to be printed as 45.7
Thanks in advance.
hi,
chk this.
data: out_qty type p decimals 1,
in_qty type p decimels 3 value ' 45.678'.
out_qty = in_qty.
write out_qty.
Rgds
Anver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
use : move qty to Temp_qty decimal 1.
Regards,
Sooness.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
declare a variable and pass the value to this.
<b>data: v_qty type p decimals 1.</b>
Thanks
eswar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Riki,
I think you can use Function Module ROUND to round off the value...
REPORT ZTEST_SHAIL4 .
data: out type p decimals 1,
inp type f.
inp = '45.678'.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS =
input = inp
SIGN = ' '
IMPORTING
OUTPUT = out
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Now use the variable 'out' to display the rounded off value...
Regards,
SP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use &QTY&(.1) if you want to only display 1 decimal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.