Skip to Content
avatar image
Former Member

decimal/comma format Conversion to integer

Hi Experts,

I need to convert a number into integer.

The number could be of the format 253.235,000 or 253,235.000.

Are there any standard procedures to do the same ?

Regards,

Kris.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jul 09, 2009 at 03:24 PM

    Hi ,

    try this way..

    data : number type int4.

    w_number = ceil ( 253,235.000 ).

    "now the w_number contains integer part..--253,235

    see the below statements..

    sign ---Plus/minus sign of the argument arg: -1, if the value of arg is negative; 0 if the value of arg is 0; 1 if the value of

    arg is positive.

    ceil --- Smallest integer number that is not smaller than the value of the argument arg.

    floor -


    Largest integer number that is not larger than the value of the argument arg.

    trunc ---Value of the integer part of the argument arg

    frac ---Value of the decimal places of the argument arg

    Prabhudas

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 09, 2009 at 03:25 PM

    Hi

    i think that u can use the function ROUND, have a look

    data: a type p value '100.635' decimals 3,
    b type i.
    
    CALL FUNCTION 'ROUND'
    EXPORTING
    DECIMALS = '0'
    input = a
    IMPORTING
    OUTPUT = b
    

    doing ur problem is solved

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 05, 2009 at 12:15 PM

    NA

    Add comment
    10|10000 characters needed characters exceeded