printf format %e does not work.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

printf format %e does not work.

跳至解决方案
925 次查看
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 解答
830 次查看
danielchai
Senior Contributor I

I figure it out. The exel format it automatically.

在原帖中查看解决方案

0 项奖励
回复
1 回复
831 次查看
danielchai
Senior Contributor I

I figure it out. The exel format it automatically.

0 项奖励
回复