iLogic: round up to nearest 5 or 10

iLogic: round up to nearest 5 or 10

Anonymous
Not applicable
2,243 Views
3 Replies
Message 1 of 4

iLogic: round up to nearest 5 or 10

Anonymous
Not applicable

I have calculated minimum required clearance gap based on user input in iLogic.

I would like to write a script that rounds up the numbers, so the last digit is always 0 or 5.

 

Example:

1 becomes 5

4 becomes 5

5 stays 5

5.5 becomes 10

9 becomes 10

1427 becomes 1430

 

Any suggestions on how to accomplish this?

0 Likes
Accepted solutions (1)
2,244 Views
3 Replies
Replies (3)
Message 2 of 4

torbjorn_heglum1
Collaborator
Collaborator
Accepted solution

In VBA I would do approximately as this to round x up to the nearest 5.

 

Ceil(x/5)*5

 

Will also work as a standard Inventor formula.

 

Torbjørn

Message 3 of 4

Anonymous
Not applicable

Thanks, this works perfectly!

0 Likes
Message 4 of 4

Kassenbouw
Enthusiast
Enthusiast

How does this work with Round?

 

Round(x/5)*5 i guess? This didn't work for me, I hope you know how this works with the Round function.

 

Cheers

0 Likes