Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to format decimal palces in c++

std::cout << std::setprecision(2) << std::fixed;
// where the 2 is how many decimal places you want
// note you need to <iomanip>
 
PREVIOUS NEXT
Tagged: #format #decimal #palces
ADD COMMENT
Topic
Name
2+6 =