I need to prevent my double to print in scientific notation in my file,
when I do this
outfile << X;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To set formatting of floating variables you can use a combination of
setprecision(n),showpointandfixed. In order to use parameterized stream manipulators likesetprecision(n)you will have to include the iomanip library:setprecision(n): will constrain the floating-output tonplaces, and once you set it, it is set until you explicitly unset it for the remainder of the stream output.fixed: will enforce that all floating-point numbers are output the same way. So if your precision is set to 4 places,6.2, and6.20will both be output as:showpoint: will force the decimal portions of a floating-point variable to be displayed, even if it is not explicitly set. For instance,4will be output as:Using them all together: