Hi,

How the fixed and scientific manipulators should be used in c++

>How the fixed and scientific manipulators should be used in c++?

The standard manipulators are defined in namespace std and presented in iomanip.

scientific format,

std::cout <<  std::setprecision(2) << std::scientific << 123.4567;

fixed format,

std::cout <<  std::setprecision(2) << std::fixed << 123.4567;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.