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

value calculation

Hi All,

Please help me,

data : a(4) type n,

b(4) type n,

c type f.

a = 185.

b = 42.

c = a / b.

  • ceal c.

write :/ c.

if ‘c’ value is 15.38, I want round that value i.e 16.

Thanks and regards,

Amjad Hussain,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 07:20 AM

    HI

    data: l_1 type i, l_2 type p decimals 2.

    l_2 = '1.78'.

    l_1 = FLOOR( l_2 ).

    l_1 = l_1 + 1.

    write: l_1.

    OR

    use Function ceil.

    w_qty = ceil( input_qty)

    2)

    use floor function

    for example...

    data: pd(5) type p decimals 2.

    pd = '30.65'.

    pd = ceil( pd ).

    pd1 = floor( pd ).

    write: pd, pd1

    it will displayed as 30 and 31...

    Message was edited by:

    Muthurajan Ramkumar

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 22, 2007 at 07:19 AM

    Hi,

    Declare c type numeric

    Regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 07:27 AM

    Hi

    Try

    data : a(4) type n,

    b(4) type n,

    c type f,

    d type i.

    a = 2185.

    b = 42.

    c = a / b.

    • ceal c.

    d = floor( c ) + 1.

    write :/ c, d.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 07:48 AM

    Hi,

    try this.

    data a(4) type n,

    b(4) type n,

    c type p.

    a = 185.

    b = 42.

    c = a / b.

    write : / c.

    declare c as packed type .

    reward if useful.

    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.