• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with printf statement.  RSS feed

 
Matrica Kovolunchy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would I create a printf statement that will print a double value with spaces before and after the value?
Ex, double x = 6.0;
( 6.0 ) - Print with 5 spaces in front and 2 spaces after.

I cannot find this anywhere, just wondering if there is a simple way to do it. Thanks!
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matrica Kovolunchy wrote: . . .
( 6.0 ) - Print with 5 spaces in front and 2 spaces after.
. . .
You mean print
(     6.0  )
The forum software doen't support multiple spaces, so you would have to use (     6.0  ) to display that on screen.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!