Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

set precision in c++

#include <iomanip.h>
#include <iomanip>
int main()
{
    double num1 = 3.12345678;
    cout << fixed << showpoint;
    cout << setprecision(2);
    cout << num1 << endl;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #precision
ADD COMMENT
Topic
Name
5+5 =