Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to get 4 decimal places in c++

#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
    double d = 122.345;
    cout << fixed << setprecision(4) << d;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #decimal #places
ADD COMMENT
Topic
Name
9+5 =