Custom property to return value with 2 decimal places

Custom property to return value with 2 decimal places

bbrumfield
Advocate Advocate
1,518 Views
3 Replies
Message 1 of 4

Custom property to return value with 2 decimal places

bbrumfield
Advocate
Advocate

How to create a custom property with 2 decimal place precision

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

WCrihfield
Mentor
Mentor
Accepted solution

You can use the Round(input number as Double, number of decimal places), but change the CInt() to CDbl() so that it returns a Double for the Round function to use.  Like this:

iProperties.Value("Custom", "Scrap Percentage") = Round(CDbl(InputBox("Enter Scrap Percentage(Enter 0 if no value is available)","Scrap Percentage",0)),2)

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4

bbrumfield
Advocate
Advocate

This works, however in Custom Properties the value returned has 0 decimal places.

 

Thanks you for helping

 

Brent

0 Likes
Message 4 of 4

bbrumfield
Advocate
Advocate

I was mistaken, after further testing the rule runs perfectly.

 

Thanks again for your help.

 

Brent

0 Likes