How to round the decimal values?
이전 댓글 표시
Hello
i have a project and i cant round up the value 0.7954 to the value 0.796, can someone help me?
Thank you.
댓글 수: 2
Walter Roberson
2020년 3월 10일
Why would it round up? To 3 decimal places it is closer to 0.795
Ahmed Roshbik
2020년 3월 10일
답변 (1개)
ceil( 0.7954 * 1000 ) / 1000
It should also be noted though that many seemingly 'round' decimal numbers cannot be perfectly represented in floating point so that you likely will not have precisely 0.796 as your final answer.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!