how to display number in decimal ?
55 次查看(过去 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 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!