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

Re: Conversion of char to float causing decimal wrong decimal value

$
0
0

Hello Srikanth,

 

Try using nthe below FM.

 

CALL FUNCTION 'CHAR_FLTP_CONVERSION'  "Format conversion: Character --> Floating point

  EXPORTING

*   dyfld = SPACE             "Screen Field name for cursor positioning

*   maskn = SPACE          "Masking character if input screen

*   maxdec = '16'               " t006-decan    Maximum number of input decimal places

*   maxexp = '59+'             " t006-expon    Maximum gross power of 10

*   minexp = '60-'               " t006-expon    Minimum gross power of 10

   string =  <pass ur char value here>                   "CHAR input field for conversion to FLTP

*   msgtyp_decim = 'W'          " sref-msgtyp   Message type for 'TOO_MANY_DECIM' (see domains)

  IMPORTING

    decim =                     "Number of decimal places determined

    expon =                     "Gross power of 10 determined

    flstr =                         "FLTP output field, from CHAR conversion

    ivalu =                        "Value in STRING flag

  EXCEPTIONS

    EXPONENT_TOO_BIG = 1        "               Gross power of 10 is too big

    EXPONENT_TOO_SMALL = 2      "               Gross power of 10 is too small

    STRING_NOT_FLTP = 3         "               STRING cannot be interpreted as floating point

    TOO_MANY_DECIM = 4          "               Too many decimal places.

 

2-11-2014 5-35-30 PM.jpg

Regards,

Thanga


Viewing all articles
Browse latest Browse all 8545

Trending Articles