orbitalfreak
Explorer
Need a little help for a program I have due tomorrow...
I need to know how to make decimal numbers display in full using C++ (devC++ from www.bloodshed.net , compiler). For instance, with:
float x1 = 1.0;
I want to code this:
cout << x1 << endl;
and have it display:
1.00000
not this:
1.0
I want it with several decimal places, not just until it terminates. Can anyone give me the function or flag to do this. I think it's something like fixed, showpos, or somethng like that.
I need to know how to make decimal numbers display in full using C++ (devC++ from www.bloodshed.net , compiler). For instance, with:
float x1 = 1.0;
I want to code this:
cout << x1 << endl;
and have it display:
1.00000
not this:
1.0
I want it with several decimal places, not just until it terminates. Can anyone give me the function or flag to do this. I think it's something like fixed, showpos, or somethng like that.
Last edited: