| Author |
Comment/Response |
MF
|
11/14/08 07:37am
Hi Ali,
I thought Mathematica had a built-in function to print 'd' decimals after the decimal point '.' but I have not found any function that does it the way I want it to, so I guess one should write his/her own function:
(*) RoundToDecimals[n_, d_] :=
NumberForm[n, {Round[$MachinePrecision], d}];
Try the above function. Now, if you are dealing with numbers that have more decimals than $MachinePrecision (not just the ones to the right of '.') you will have to change (*) a bit..
I have learned, when using NumberForm, that the output produced cannot be used as input to one of the Plot functions, for instance - it will simply produce an empty plot.
URL: , |
|