File Exchange

image thumbnail

ROUND2DP

version 1.0.0.0 (1.14 KB) by Andrew
Round a number to a given number of decimal places

2 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 (2021). ROUND2DP (https://www.mathworks.com/matlabcentral/fileexchange/24213-round2dp), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Gabriel Ruiz Martinez

Alexandre

Derek Fryar

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!