Answers for "how to round a double to 2 decimal places in c"

C++
2

how to round a double to 2 decimal places in c++

value = round( value * 100.0 ) / 100.0; // 2 decimal places
value = round( value * 1000.0 ) / 1000.0; // 3 decimal places
Posted by: Guest on September-13-2020
3

round number at 2 decimal places

Math.round(num * 100) / 100
Posted by: Guest on March-17-2021

Code answers related to "how to round a double to 2 decimal places in c"

Browse Popular Code Answers by Language