1

I have output like this:

1569.3669
15968.3699
41.3878
587.5401

but I want the output like this:

01569.3669
15968.3699
00041.3878
00587.5401

How can I do this in the C language?

0

1 Answer 1

7
printf("%010.4f", val);

Should do it for you, where val is each value. For more info see here

Edit: Thanks Barry.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.