double number format

Hello everyone,

In one of my programs I use a very large number of type double. The number is 12000000. When I run the program and output the number it is represented as 1.2e+007, I want it to be represented as 12000000. If anyone has a solution that would be very helpful(I use Dev C++).

Thanks.
is it 12000000. or 12000000 double means that you need a period and two numbers after it so for example:
An int can be 15 or -2
A float can be 16.4 or 210.0
A double can be 4783.93 or -433.00
It's 12000000.00, a double number.
Try

#include <iomanip>
cout << fixed << yourDoubleValue << endl;

The fixed will stop it from printing 1.2e+7.
Last edited on
well you dont need it for a double only everything after that
Thanks histrungalot
Last edited on
it was printing that way cause he didnt use decimals
Topic archived. No new replies allowed.