Skip to content

Commit

Permalink
fix for 1mA displayed as 1000uA
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Aug 15, 2019
1 parent 2703850 commit 00685bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/eez/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ uint8_t fromBCD(uint8_t bcd) {
}

float roundPrec(float a, float prec) {
return roundf(a / prec) * prec;
float r = 1 / prec;
return roundf(a * r) / r;
}

bool between(float x, float a, float b) {
Expand Down

0 comments on commit 00685bd

Please sign in to comment.