Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

setting ToString() decimal places

Status
Not open for further replies.

multicaduser

Industrial
Jan 29, 2013
261
0
16
US
In getting the sizes from the "ufs.Modl.AskBoundingBoxExact" function and creating a string from the distances, I'm having difficulty figuring out how to set the format decimal places to four using the "distances(0).ToString()".

In expressions I would use "format("%.4f",variable), but that doesn't work. Is there a way to set the decimal places directly or does it need to be done post conversion? Then there is the question of the function dropping trailing zeroes.

Can someone give me a hint?

tia

NX 12.0.1.7 Windows 10
 
Replies continue below

Recommended for you

Thanks again cowski, great help. Knuckle dragger that I am I found it a couple of minutes after posting.

distances(0).ToString("0.0000")

NX 12.0.1.7 Windows 10
 
Status
Not open for further replies.
Back
Top