printf format %e does not work.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

printf format %e does not work.

Jump to solution
397 Views
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 Kudos
1 Solution
302 Views
danielchai
Senior Contributor I

I figure it out. The exel format it automatically.

View solution in original post

0 Kudos
1 Reply
303 Views
danielchai
Senior Contributor I

I figure it out. The exel format it automatically.

0 Kudos