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 JAE 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
Joined
Jul 14, 2009
Messages
2
Location
US
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?
 
can't you use ROUND first?

TTFN

FAQ731-376
 
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

Back
Top