Large numbers

T

Tom McCallum

Is there any way to override the normal output of doubles? I am
outputting numbers around 5 million and would like them to be formatted
normally (5000000) instead of with exponents (5e06). What is the best way
to do this?

I am just using standard out such as
double i = 5000000;
cout << i << endl;

Many thanks in advance,

Tom
 
T

Tim Love

Tom McCallum said:
Is there any way to override the normal output of doubles? I am
outputting numbers around 5 million and would like them to be formatted
normally (5000000) instead of with exponents (5e06). What is the best way
to do this?
I am just using standard out such as
double i = 5000000;
cout << i << endl;

cout.setf(ios::fixed,ios::floatfield);
(use "scientific" instead of "fixed" to get exponents)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top