iLogic Round Function to 3rd Decimal

iLogic Round Function to 3rd Decimal

timothy_berg
Advocate Advocate
3,768 Views
2 Replies
Message 1 of 3

iLogic Round Function to 3rd Decimal

timothy_berg
Advocate
Advocate

 

iProperties.Value("Custom", "SQINCH") = SheetMetal.FlatExtentsArea
Parameter("SQINCH") = iProperties.Value("Custom", "SQINCH")
A1 = (SQINCH/144)
iProperties.Value("Custom", "SQFOOT") = A1

Above is the code i have for converting the extents area to sq foot, what i would like to do is round off the decimal places to 2 places beyond the decimal for example 123.45. I have tried the round function and i can't figure what i'm missing any help will be greatly appreciated.

0 Likes
Accepted solutions (2)
3,769 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi timothy.berg,

 

 

Here's a quick working example:

 

SQINCH = 5000
A1 = Round((SQINCH/144),2) 'rounds to 2 places
MessageBox.Show("SQ FT: " & A1, "iLogic - 2 decimals")

A1 = Round((SQINCH/144),3) 'rounds to 3 places
MessageBox.Show("SQ FT: " & A1, "iLogic - 3 decimals")

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

 

EESignature

Message 3 of 3

timothy_berg
Advocate
Advocate
Accepted solution

Thanks Curtis i didn't realize i had to add the extra () that works, thanks again.

0 Likes