Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write <x.2@Height> without trailing zeros?

Status
Not open for further replies.

IvanNX

Mechanical
Jun 9, 2005
267
How to write <x.2@Height> in a note without trailing zeros?
My value can be round number or decimal number, when it is round number I get two zeros after decimal mark, can it be done so if it is round number there is not trailing zeros?
Is there any guide for how to use text notes and PMI with expressions, attributes etc.???

_____________________________
Enjoy your work and have fun!
 
Replies continue below

Recommended for you

hrm, x.2 means 2 decimals...


regards,
Tomas
 
Yes, but can that be written so if it is round number there is no zeros after? What to put instead of .2? x@Height gives rounded number with no decimals at all.

_____________________________
Enjoy your work and have fun!
 
In the expression editor, create a string expression with the fomula:

Code:
format("%0.3g", Height, "units", "unitless")

The "g" format specifier will ignore trailing zeros. You can reference this new expression in your note rather than referencing the "Height" expression directly.

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor