形如" 1.8000000000000000E+05" 转成浮点数 50.00, 代码如下:
DATA: lw_qmih TYPE qmih,
lv_floatout LIKE qmih-auszt,
Lv_floatp TYPE p DECIMALS 2
.
SELECT SINGLE * INTO lw_qmih
FROM qmih
WHERE qmnum = '000010002087'.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = lw_qmih-auszt
unit_in = 'S'
unit_out = 'H'
IMPORTING
output = lv_floatout
EXCEPTIONS
conversion_not_found = 1
division_by_zero = 2
input_invalid = 3
output_invalid = 4
overflow = 5
type_invalid = 6
units_missing = 7
unit_in_not_found = 8
unit_out_not_found = 9
OTHERS = 10.
lv_floatp = lv_floatout.
WRITE:lv_floatp.