Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Parameter Not Rounding Correctly

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
j_berry
2186 Views, 5 Replies

Parameter Not Rounding Correctly

I'm getting unexpected results using "round( )" in the parameters table. File attached (Inventor 2014). Details below.

 

width = 35.125

 

end_result = round(width)

 

Nominal value for "end_result" is 35.039370. Why is this not rounding to exactly 35?

AutoCAD Electrical 2013 SP2
Windows 7 Pro SP1
5 REPLIES 5
Message 2 of 6
cwhetten
in reply to: j_berry

It's probably a units problem.  For whatever reason, the round( ) function expects a unitless value, and returns a unitless value.  So, if width and end_result are in mm, you will have to write your function like this:

 

round( width / 1mm ) * 1mm

 

The ceil( ) and floor( ) functions suffer the same ailment.

 

Cameron Whetten
Inventor 2014

Please click "Accept as Solution" if this response answers your question.

Message 3 of 6
Curtis_Waguespack
in reply to: j_berry

 

Hi  j_berry,

 

See this link for further information:

http://forums.autodesk.com/t5/Autodesk-Inventor/parameter-rounding-up-to-nearest-fractional-part-of-...

 

If that helps, you might give  cwhetten a couple of kudos for the well written explanation. Smiley Wink

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 4 of 6
brucejwheeler
in reply to: j_berry

Is there a way to "round up" or "round down"? This would give a conditional number.

If I round()*1, I may get a decimal number (less than 1). My preference would be to rounddown to recieve a lwer whole number.

Message 5 of 6
mikejones
in reply to: brucejwheeler

You'll need to use FLOOR() or CEIL() to round up or down respectively

 

Mike

Autodesk Certified Professional
Message 6 of 6
brucejwheeler
in reply to: mikejones

Thanks Mike this works!!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report