[noob][c++] enum + float

precision and rounding and maybe other settings for float type needs to be adjusted

is enum what I should use?

I checked c++ in a nutshell by oreilly, but I can't seem to find any thing from it about enum.


how do I do this?
TroudeloupAsked:
Who is Participating?
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
float value remains untouched. It is just a presentation matter.
0
 
Jaime OlivaresSoftware ArchitectCommented:
could you detail more your problem?
0
 
TroudeloupAuthor Commented:
yeah.


float a;
a = 13000075

cout << a;


it output this


1.30001e+007
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
TroudeloupAuthor Commented:
or more precisely,


what is enum and how do I use it?
0
 
Jaime OlivaresSoftware ArchitectCommented:
you need to learn about STL output manipulators:

cout.precision(0);
cout <<   fixed    << a  << endl;

There are lots of manipulators, have a look to:
http://www.cplusplus.com/reference/iostream/manipulators/
0
 
Jaime OlivaresSoftware ArchitectCommented:
I don't figure out how enumerations can help you in this issue.
0
 
TroudeloupAuthor Commented:
are you saying that it's cout that chop off the parts, not the float type itself?
0
All Courses

From novice to tech pro — start learning today.