How to round number using integer only


Results 1 to 3 of 3

Threaded View

  1. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: How to round number using integer only

    You can use the DIG comand!

    Let assume your word variable that contains 4557 is named R_Value, then:

    AA0 VAR BYTE

    AA0 = R_Value DIG 0
    If AA0 > 5 then
    R_Value = R_Value + (10 - AA0)
    ENDIF

    .... and you will round as requested.

    Cheers


    Al.
    Last edited by aratti; - 6th March 2011 at 13:20.
    All progress began with an idea

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts