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

Conversion of char to float causing decimal wrong decimal value

$
0
0

Hi ,

 

I have float value 2.6000000000000003E-03 which i converted to char using fm  RS_CHECK_CONV_EX_2_IN_NO_DD

 

the result of it is 0.002600

 

later when i move the value back to float result is 2.5999999999999993E-03

 

same code :

 

data:lv_temp(128),

        lv_value type zflpt. " zfltp domian is FLTP

 

lv_value = '2.6000000000000003E-03'.

 

lv_temp = lv_value.

 

   ls_convert-type = 'P'.

   ls_convert-length = 13.

   ls_convert-decimals = 6.

   ls_convert-ddic_leng = 13.

   ls_convert-sign = c_true.

 

CALL FUNCTION 'RS_CHECK_CONV_EX_2_IN_NO_DD'

     EXPORTING

       input_external               = lv_temp

       descr                           =   ls_convert

     IMPORTING

       input_i_format               = lv_temp

 

 

lv_temp has value 0.002600

 

but when i move lv_temp to lv_value value is 2.5999999999999993E-03.

 

Please help me in solving this.

 

Regards,

Srikanth


Viewing all articles
Browse latest Browse all 8118

Trending Articles