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: 

Setting decimal precision for text derived from number.

1 REPLY 1
Reply
Message 1 of 2
anthony.desilva
415 Views, 1 Reply

Setting decimal precision for text derived from number.

I'm using ilogic to automatically build standardized descriptions that are linked to a field in our PDM system for future searches.  The problem is that the variable "Length" (shown below) can sometimes be a whole number so it drops the trailing zeros and I want it to always be a two decimal value.  Any suggestions?

 

Formula:

iProperties.Value("Custom", "2ND_SUBTITLE")=CStr(ID)+" ID x "+CStr(OD)+" OD "+CStr(Round(Length, 2))+" LG"

 

Computed String Value

2.701 ID x 3.253 OD x 8 LG

1 REPLY 1
Message 2 of 2
bobvdd
in reply to: anthony.desilva

Could you try replacing the string

 

CStr((Round(Length, 2))

 

with

 

CStr(Format(Round(Length, 2),".00"))

 

Bob




Bob Van der Donck


Principal UX designer DMG group

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

Post to forums  

Autodesk Design & Make Report