How to round number up to a specific number of decimal places?

3 views (last 30 days)
Suppose I have a variable x=0.34; is there a function (or how would one look like) to round this number up to, say 0.4 (next highest number with one decimal place)?
Just like ceil, but with decimals?

Accepted Answer

Alan Stevens
Alan Stevens on 3 Aug 2020
ceil(10*x)/10

More Answers (0)

Categories

Find more on Data Types in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!