Message Boards Message Boards

0
|
4279 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

[?] Get two significant digits to the right of the decimal point?

Posted 7 years ago

N[x,3] gives me 1.10 and 0.982, when what I want is 0.98. How do I get two and only two digits to the right of the decimal point?

POSTED BY: Nelson Zink
3 Replies

If it is the formatting that is of interest rather than the underlying value, could use DecimalForm[0.982,{Infinity,2}] This is new in version 11.2 I think, but there are ways to attain the same in prior versions using NumberForm.

POSTED BY: Daniel Lichtblau
N[x, {Infinity, 2}]

provided x is not of machine precision (MachinePrecision).

POSTED BY: Michael Rogers
Posted 7 years ago

Thanks.

POSTED BY: Nelson Zink
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract