exponential form instead of decimal

okay so I dont know how to fix this, im trying to get 3021869 and im getting 3.02187e+006. im not quite sure why, i tried to change my double to a long double and nothing changed.

could someone help me lol

#include <iostream>

using namespace std;

int main()
{
long double r = 0;
long double w = 0;
long double p = 3.14159265;
long double t = 0;
long double world = 196935000;
long double total=0;



cout << "enter the radius" << endl;
cin >> r;
cout << "enter width" << endl;
cin >> w;

t = 2*p*r*w;

total= t/world;

cout << total << " Earths" << endl;

return 0;
}

cout<<std::fixed;
The default precision is 6 significant digits. You can change that by for example
cout.precision(10);
Topic archived. No new replies allowed.