Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

round double to 2 decimal places c++

double d; 
	std::cout.precision(3); // for accurancy to 3 decimal places
	std::cout << d << std::endl;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #double #decimal #places
ADD COMMENT
Topic
Name
1+5 =