File Exchange

image thumbnail


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

1 Download

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 =

>> round2dp(pi,3)
ans =

Cite As

Andrew (2021). ROUND2DP (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Gabriel Ruiz-Martinez


Derek Fryar

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

Inspired by: round2

Community Treasure Hunt

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

Start Hunting!