How to round a floating point type to two decimals or more in C++? [duplicate]

  c++, c++17, floating-point

How can I round a float to two decimals points or more in C++17? I’m not looking to print/output the rounded float, but to actually change the value. Also, what’s the most efficient method if I’m constantly iterating through a loop and rounding floats?

Source: Windows Questions C++

LEAVE A COMMENT