‎2007 Feb 07 11:48 AM
Hi,
I'm having problem when converting a float variable to char - it seems like the float value is automatically rounded into the char variable, but I don't want that.
Does anybody know a wafunction or a way of avoiding this convertion round?
Thanks,
Nuno Afonso
‎2007 Feb 07 12:07 PM
this should solve
REPORT YCHATEST.
DATA : V_FLOAT TYPE F VALUE '2456.5678912',
V_CHAR(25),
P10_4(10) TYPE P DECIMALS 8.
CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
EXPORTING
FLOAT_IMP = V_FLOAT
FORMAT_IMP = P10_4
ROUND_IMP = ' '
IMPORTING
CHAR_EXP = V_CHAR.
WRITE : V_CHAR.
‎2007 Feb 07 11:51 AM
‎2007 Feb 07 11:54 AM
Hi,
I've tried to use this function, but I get no results... Can you please help me with the input parameters?
‎2007 Feb 07 12:00 PM
Hi
use above FM FLTP_CHAR_CONVERSION
and pass these values
DECIM 15/ per the req
EXPON 0
INPUT 11.11111111111
IVALU SPACE
MASKN SPACE
Regards
Shiva
‎2007 Feb 07 12:08 PM
With the input parameters you gave me...
Error in ASSIGN: Memory protection error
The current program "SAPLSCFL " uses the ASSIGN statement.
However, the offset of the segment (536) plus the length (1)
is greater than the length of the segment (536).
This is not allowed.
‎2007 Feb 07 12:13 PM
Hi
i tested the same and it is working for me.
please check the input parameter for u i am having . for decimals
Regards
Shiva
‎2007 Feb 07 11:54 AM
Hi
use FM
FLTP_CHAR_CONVERSION
FLTP_CHAR_CONVERSION_FROM_SI
Regards
Shiva
‎2007 Feb 07 12:07 PM
this should solve
REPORT YCHATEST.
DATA : V_FLOAT TYPE F VALUE '2456.5678912',
V_CHAR(25),
P10_4(10) TYPE P DECIMALS 8.
CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
EXPORTING
FLOAT_IMP = V_FLOAT
FORMAT_IMP = P10_4
ROUND_IMP = ' '
IMPORTING
CHAR_EXP = V_CHAR.
WRITE : V_CHAR.