×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Round number to certain number of digits

Round number to certain number of digits

Round number to certain number of digits

(OP)
Is it possible to round numbers to a specific number of digits?

ie round(19.0475, 2) = 19.05

Can't seem to figure out how to accomplish anything but:
round(19.0475) = 19

Thanks!

RE: Round number to certain number of digits

In what context?  Are we talking about when making a drawing or when creating expressions?

John R. Baker, P.E.
Product "Evangelist"
NX Product Line
UGS Corp
Cypress, CA
http://www.ugs.com

RE: Round number to certain number of digits

(OP)
John,
When creating expressions.
Thanks.

RE: Round number to certain number of digits

Given the following:

X = the original number you wish to round

XR = the result after rounding

places = represents the number of places that you wish to round to, using the following scheme:

1 decimal place  = 10
2 decimal places = 100
3 decimal places = 1000
etc.

Also make sure that the places expression has a dimensionality of "Constant".

This then gives you a final expression of:

XR = round(X*places)/places

Of course you could replace the variable "places" in the above expression with the 10's, 100's, 1000's, etc. as needed.

John R. Baker, P.E.
Product "Evangelist"
NX Product Line
UGS Corp
Cypress, CA
http://www.ugs.com

RE: Round number to certain number of digits

(OP)
John,
Once again, you give perfectly clear (and functional) direction!
Thanks a lot,
Abe

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources