Cody

Problem 46736. Round to Nearest Multiple of 10^n

Solution 3259093

Submitted on 18 Oct 2020 by ChrisR
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 8137; n=2; y_correct = 8100; assert(isequal(round_10_n(x,n),y_correct))

2   Pass
x=45321; n=3; y_correct = 45000; assert(isequal(round_10_n(x,n),y_correct))

Suggested Problems

Community Treasure Hunt

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

Start Hunting!