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.
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
Bookmarks