フィルターのクリア

Scientific notation to decimal?

125 ビュー (過去 30 日間)
Anna
Anna 2013 年 8 月 4 日
コメント済み: Basílio Gonçalves 2017 年 10 月 19 日
I currently have a number that I want in decimal form not scientific form. I have
Savings made in dollars:
1.0418e+06
How do I get the 1.0418e+06 into decimal? Is there a function for this? In my script file I have
disp('Savings made in dollars: ' )
disp(savings)
So I was wondering if there was a function that i can enter in the disp(savings) bit to make my number a decimal?
I am very new to MATLAB so a basic explanation is much appreciated.

採用された回答

dpb
dpb 2013 年 8 月 4 日
>> sav=1.0418e+06;
With cents displayed...
>> disp(num2str(sav,'%.2f'))
1041800.00
Whole dollars...
>> disp(num2str(sav,'%.0f'))
1041800
Also see
doc fprintf % and friends

その他の回答 (2 件)

Jan
Jan 2013 年 8 月 4 日
編集済み: Jan 2013 年 8 月 4 日
format bank
price = 1.0418e+06
% >> 1041800.00
  1 件のコメント
Basílio Gonçalves
Basílio Gonçalves 2017 年 10 月 19 日
thanks :D

サインインしてコメントする。


Azzi Abdelmalek
Azzi Abdelmalek 2013 年 8 月 4 日
a=1.0418e+06
out=sprintf('%10.2f',a)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by