Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Control decimal places with num2str 1

Status
Not open for further replies.

justinmiller

Mechanical
Jul 14, 2009
2
I am displaying values inside of an excel table in mathcad. Simply putting the variable as an input will strip off the unit so I have re-added it by using something similar to:

concat(num2str(theta),”°”)

This works great except the value displayed is shown out to 13 decimal places and i only need 2. Any ideas on how to control num2str or for a differant approach altogether?
 
Replies continue below

Recommended for you

Thanks, i didnt know about that, but it works great.

For future reference it looks like this now:
concat(num2str(round(theta,2)),"°")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor