Try build a FB like this one, it should do the work.
value := (input MOD 10); IF value <> 0 THEN Output := input + (10 - (input MOD 10)); ELSE Output := input; END_IF
/Niclas
NP, sure.
value := (input MOD 10); IF value > 5 THEN Output := input + (10 - (input MOD 10)); ELSE IF value = 5 THEN Output := input + (10 - (input MOD 10)); ELSE IF value < 5Β THEN Output := input - (input MOD 10); ELSE Output := input; END_IF END_IF END_IF
another solution: this type of function is also available at w www.oscat.de w (it is english)
rounding function.rar [5.83 KiB]
Log in to post a comment.
Try build a FB like this one, it should do the work.
/Niclas
NP, sure.
/Niclas
another solution:
this type of function is also available at w www.oscat.de w (it is english)
rounding function.rar [5.83 KiB]