954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Lining up number at the decimal.

i am just doing the finishing on my project and i was wondering if anyone can help me, i cant figure out how to line up the output at the decimal place.
i know it is something to do with the " %.2lf " in the printf statement but i cannot figure it out.

mar666
Newbie Poster
5 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

u can use setw() function....

paresh_chitte2k
Newbie Poster
1 post since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

i am using C not ++

mar666
Newbie Poster
5 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

Try use "%10.2lf" specificator format (a suggestion, you can use other values, of course :lol: ).

frrossk
Posting Whiz in Training
220 posts since Sep 2004
Reputation Points: 17
Solved Threads: 9
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You