Answers for "how to round decimal to 2 in cpp"

C++
0

round double to 2 decimal places c++

double d = 0.12345;
std::cout.precision(2); // for accuracy to 2 decimal places 
std::cout << d << std::endl; // 0.12
Posted by: Guest on September-13-2020

Code answers related to "how to round decimal to 2 in cpp"

Browse Popular Code Answers by Language