+ 1
how to convert 5.3333 to 5.33 in cpp
cpp based
4 Answers
+ 6
universal answer for any language:
1. multiply with 100,
2. cast to integer
3. cast back to float/double
4. divide with 100
+ 3
u can use fixed setprecision () function also
or printf ("0.2f0.2f")
+ 1
std::floor(), std::ceil() or round() from cmath
- 1
can u please upvote my que