It's often useful for me to round numbers to some decimal place for printing on a graph or figure. I usually do this by:
RoundedNumber = Round[NumberToRound, 0.001]
But if the resultant rounding is say 1.2
from 1.19
, I would like to keep the trailing zero; so 1.20
. The reason being is that I represent by errors in bracketed notation -- where the number in brackets represents the error in the last digit. E.g. 1.20(2)
-- so as you can see it is important to keep the trailing zero as 1.2(2)
has a different meaning to 1.20(0)
Does anyone a way I can do this?
1.99
cannot round to1.2
. Did you mean1.19
? Take a look atNumberForm
.NumberForm[1.19, {2, 2}]
=1.20
. $\endgroup$NumberForm[...]
until now! PS corrected in the original question... $\endgroup$NumberForm[1.186, {\[Infinity], 2}]
for precisely two digits to the right of the decimal dot. $\endgroup$