how to display number in decimal ?
조회 수: 64 (최근 30일)
이전 댓글 표시
Hello everyone, I have tried :
format long
format short
value=double(value)
and the output still fraction number how can I convert it to decimal ?
댓글 수: 3
Walter Roberson
2018년 7월 13일
int(value) is an error unless the value is symbolic.
Perhaps the user wants
format bank
for 2 decimal places. Or perhaps the user wants fix() or floor() . Or perhaps round() with a particular number of decimal places.
Stephen23
2018년 7월 13일
Reema Alhassan discusses this in much more detail here:
답변 (1개)
Steven Lord
2018년 7월 14일
Since it's likely the "fraction number" is stored as a symbolic object, try calling either the vpa function or the double function with your symbolic number as input.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!