Skip to content

Commit

Permalink
more precision for scaled values
Browse files Browse the repository at this point in the history
  • Loading branch information
Phunkafizer committed Jan 8, 2023
1 parent 8a06202 commit 8053c84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MBUSPayload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ uint8_t MBUSPayload::decode(uint8_t *buffer, uint8_t size, JsonArray& root) {

// scaled value
int8_t scalar = vif_defs[def].scalar + vif - vif_defs[def].base;
float scaled = value;
double scaled = value;
for (int8_t i=0; i<scalar; i++) scaled *= 10;
for (int8_t i=scalar; i<0; i++) scaled /= 10;

Expand Down

0 comments on commit 8053c84

Please sign in to comment.