MATLAB Answers

Round down lowest number in a decimal number

82 views (last 30 days)
Martin
Martin on 11 Apr 2018
Commented: Martin on 11 Apr 2018
Hello, say I have a number 4.214513. Then I need to return 4.21. Likewise if I have 4.219999, I need to return 4.21. Is there any function or other method to achieve this in Matlab?

  0 Comments

Sign in to comment.

Accepted Answer

James Tursa
James Tursa on 11 Apr 2018
E.g.,
x = whatever
result = floor(x*100)/100;

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.