Click here to Skip to main content
15,920,633 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Visual Studio C++ 6.0 Dialog question Pin
Gwenio4-Mar-10 16:50
Gwenio4-Mar-10 16:50 
AnswerRe: Visual Studio C++ 6.0 Dialog question Pin
KarstenK4-Mar-10 21:31
mveKarstenK4-Mar-10 21:31 
QuestionConvert a file into .doc template? Pin
gedinfo4-Mar-10 11:18
gedinfo4-Mar-10 11:18 
AnswerRe: Convert a file into .doc template? Pin
«_Superman_»4-Mar-10 15:44
professional«_Superman_»4-Mar-10 15:44 
Questionusing flags for cout [Solved] Pin
b-rad3114-Mar-10 11:16
b-rad3114-Mar-10 11:16 
AnswerRe: using flags for cout Pin
Gwenio4-Mar-10 11:58
Gwenio4-Mar-10 11:58 
GeneralRe: using flags for cout Pin
b-rad3114-Mar-10 12:12
b-rad3114-Mar-10 12:12 
GeneralRe: using flags for cout [modified] Pin
Gwenio4-Mar-10 13:38
Gwenio4-Mar-10 13:38 
Wrong (I just tested). There are no trailing 0's with the default flags, and it will not use scientific as long as the number of digits does not exceed the value you set precision for. Default: showpoint unset, scientific unset, and fixed unset.

#include <iostream>
int main() {
	std::cout.precision(14);
	std::cout << 90.00 << std::endl;
	std::cout << 99999999999999.0 << std::endl;
	std::cout << 9.85545 << std::endl;
	return 0;
}


The above code produces the output you desire.

To reset the appropriate flags to the default use the following:

std::cout.unsetf(ios::showpoint);//Set it to not show the decimal point.
std::cout.unsetf(ios::scientific);//Do not force scientific format.
std::cout.unsetf(ios::fixed);//Do not force it to show the value of percision in digits.
modified on Thursday, March 4, 2010 10:23 PM

GeneralRe: using flags for cout Pin
«_Superman_»4-Mar-10 16:03
professional«_Superman_»4-Mar-10 16:03 
GeneralRe: using flags for cout [modified] Pin
Gwenio4-Mar-10 16:19
Gwenio4-Mar-10 16:19 
GeneralRe: using flags for cout Pin
b-rad3114-Mar-10 17:01
b-rad3114-Mar-10 17:01 
Questionctime - localtime -> GMT question Pin
minkowski4-Mar-10 6:29
minkowski4-Mar-10 6:29 
AnswerRe: ctime - localtime -> GMT question Pin
Graham Breach4-Mar-10 7:59
Graham Breach4-Mar-10 7:59 
GeneralRe: ctime - localtime -> GMT question Pin
minkowski4-Mar-10 22:53
minkowski4-Mar-10 22:53 
Questionpresent int as char Pin
Aljaz1114-Mar-10 5:01
Aljaz1114-Mar-10 5:01 
AnswerRe: present int as char Pin
Eugen Podsypalnikov4-Mar-10 5:20
Eugen Podsypalnikov4-Mar-10 5:20 
AnswerRe: present int as char Pin
«_Superman_»4-Mar-10 16:08
professional«_Superman_»4-Mar-10 16:08 
AnswerRe: present int as char [modified] Pin
Gwenio4-Mar-10 16:42
Gwenio4-Mar-10 16:42 
QuestionLoadIcon from file Pin
johnalek4-Mar-10 4:40
johnalek4-Mar-10 4:40 
AnswerRe: LoadIcon from file Pin
Eugen Podsypalnikov4-Mar-10 4:51
Eugen Podsypalnikov4-Mar-10 4:51 
QuestionEmbeded local web server Pin
ryanstd4-Mar-10 2:13
ryanstd4-Mar-10 2:13 
AnswerRe: Embeded local web server Pin
Chris Losinger4-Mar-10 3:39
professionalChris Losinger4-Mar-10 3:39 
GeneralRe: Embeded local web server Pin
ryanstd4-Mar-10 4:45
ryanstd4-Mar-10 4:45 
GeneralRe: Embeded local web server Pin
Chris Losinger4-Mar-10 5:25
professionalChris Losinger4-Mar-10 5:25 
AnswerRe: Embeded local web server Pin
QuiJohn4-Mar-10 4:45
QuiJohn4-Mar-10 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.