round2 use float instead of double (6 point precision is enough)

This commit is contained in:
proddy
2021-09-19 21:28:21 +02:00
parent ee34dd72f7
commit 401929d992
2 changed files with 2 additions and 2 deletions

View File

@@ -359,7 +359,7 @@ uint16_t Helpers::atoint(const char * value) {
// rounds a number to 2 decimal places
// example: round2(3.14159) -> 3.14
double Helpers::round2(double value, const uint8_t divider) {
float Helpers::round2(float value, const uint8_t divider) {
uint8_t div = (divider ? divider : 1); // prevent div-by-zero
if (value >= 0) {