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!
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
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
When creating expressions.
Thanks.
RE: Round number to certain number of digits
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
Once again, you give perfectly clear (and functional) direction!
Thanks a lot,
Abe