[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 OlivaresSoftware 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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.