How can I round a float value (such as 37.777779) to two decimal places (37.78) in C?
You can still use:
float ceilf(float x); // don't forget #include and link with -lm.
example:
float valueToRound = 37.777779; float roundedValue = ceilf(valueToRound * 100) / 100;