ROUND2DP

Version 1.0.0.0 (1.14 KB) by Andrew
Round a number to a given number of decimal places
1.2K Downloads
Updated 20 May 2009

View License

This expands on the operation of the built-in ROUND function to provide functionality to round to a given number of decimal places. For example,

>> round(pi)
ans =
3

>> round2dp(pi,3)
ans =
3.142

Cite As

Andrew (2024). ROUND2DP (https://www.mathworks.com/matlabcentral/fileexchange/24213-round2dp), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: round2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0