Skip to Content
author's profile photo Former Member
Former Member

Remove decimal points from variable.

Hi,

I have a little issue.

I have one variable v = 25.000

and i want to remove (.000) from this variable so my result will be only 25 and i want this.

So, is ther any function to remove this?

I want to do it in one shot.

No 2-3 statements.

Points rewarded soon

Regards

RH

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 07:06 AM

    HI

    Declare the variables as

    data: v_number type p decimals 0.

    Regards

    Aditya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 07:07 AM

    Define one integer type variable and pass the data to it.

    data: v_amt type i.

    v_amt = 25.000.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Ronny,

      Calling a function is performance intensive for this functionality. Why do you want to use a function when the same could be attained only by two statements.

      Still if you think, the same should be done... you could write your own function module for it with the two lines of code.

      Reward points if this helps,

      Kiran

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 07:10 AM

    Hi Ronny,

    You move this variable data to an integer variable.

    Data: v_tempint type i.

    move your_variable to v_tempint.

    v_tempint will have the required result.

    Reward points if this helps,

    Kiran

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 07:11 AM

    data: tt type p decimals 3,

    ch(10) type c.

    tt = '233.453'.

    write:/ tt decimals 0.

    reward if useful........

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 25, 2008 at 07:18 AM

    Hi,

    Try FM ROUND.

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.