Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

round double to n decimal places c++

value = round( value * 100.0 ) / 100.0; // 2 decimal places
value = round( value * 1000.0 ) / 1000.0; // 3 decimal places
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #double #decimal #places
ADD COMMENT
Topic
Name
4+4 =