home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18380 < prev    next >
Encoding:
Text File  |  1992-12-23  |  796 b   |  33 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!stanford.edu!lucid.com!lucid.com!jss
  3. From: jss@lucid.com (Jerry Schwarz)
  4. Subject: Re: Help with floating point I/O (well, really O)
  5. Message-ID: <1992Dec24.022757.23721@lucid.com>
  6. Sender: usenet@lucid.com
  7. Reply-To: jss@lucid.com (Jerry Schwarz)
  8. Organization: Lucid, Inc.
  9. References:  <1992Dec22.200420.1734@brtph560.bnr.ca>
  10. Date: Thu, 24 Dec 92 02:27:57 GMT
  11. Lines: 20
  12.  
  13. In article <1992Dec22.200420.1734@brtph560.bnr.ca>, markham@brtph597.bnr.ca (Andrew Markham P205) writes:
  14.  
  15. |>             cout << setprecision(3) << setw(6) << .1 << endl;
  16. ...
  17.  
  18. |> Prints the following output:
  19. ...
  20. |>            0.1
  21. ...
  22. |> How do I get it to print the following?
  23. ...
  24. |>          0.100
  25. ...
  26.  
  27. Do 
  28.     cout.setf(ios::fixed) 
  29.  
  30. before inserting the numbers
  31.  
  32.   -- Jerry Schwarz
  33.