printf format %e does not work.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

printf format %e does not work.

ソリューションへジャンプ
399件の閲覧回数
danielchai
Senior Contributor I

Hi All,

I have a float number data = 25.99978

and I want to using sprintf to format it to %e.

sprintf(pointer, "%15.8e", data);

but pointer always 2.5e+01.

How should I do so it can format the width to 15 and precision to 8.

Thank you.

-Daniel

0 件の賞賛
1 解決策
304件の閲覧回数
danielchai
Senior Contributor I

I figure it out. The exel format it automatically.

元の投稿で解決策を見る

0 件の賞賛
1 返信
305件の閲覧回数
danielchai
Senior Contributor I

I figure it out. The exel format it automatically.

0 件の賞賛