Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Jun 9, 2005
Messages
267
Location
SE
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!
 
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

Back
Top