How do I round off exponential numbers?
Show older comments
I have a code for which I get a long exponential number eg. a = 2.572920056e-3 as the output. I need to round off only the non-exponential part i.e I want the output to be something like 2.573e-3.
I know how to round off integers using ceil, round etc, but how can one round off only the number outside the exponential like mentioned above. Also, the output varies so I cannot use a command with a fixed number like
(ceil(a*10^6)/10^6).
(The fixed number being '6' in this case).
Accepted Answer
More Answers (0)
Categories
Find more on Precision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!