how to display number in decimal ?

조회 수: 64 (최근 30일)
Reema Alhassan
Reema Alhassan 2018년 7월 13일
답변: Steven Lord 2018년 7월 14일
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
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
Stephen23 2018년 7월 13일

댓글을 달려면 로그인하십시오.

답변 (1개)

Steven Lord
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.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by