Skip to content

Commit

Permalink
adding rounding to power/day valyes in fronius.php (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
henkisdabro authored Jan 24, 2024
1 parent 22f0d1d commit 7834206
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Fronius/Fronius.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public function livestats()
$data = [];
$data["PAC"] = 0;
foreach ($details->Body->Data->PAC->Values as $key => $pac) {
$data["PAC"] += $pac;
$data["PAC"] += round($pac,0,PHP_ROUND_HALF_UP);
}
$data["PAC_UNIT"] = $details->Body->Data->PAC->Unit;

$data["DAY_ENERGY"] = 0;
foreach ($details->Body->Data->DAY_ENERGY->Values as $key => $ev) {
$data["DAY_ENERGY"] += $ev;
$data["DAY_ENERGY"] += round($ev,0,PHP_ROUND_HALF_UP);
}
$data["DAY_ENERGY_UNIT"] = $details->Body->Data->DAY_ENERGY->Unit;

Expand Down

0 comments on commit 7834206

Please sign in to comment.