Skip to content

Commit

Permalink
Merge pull request #1325 from Adminius/patch-11
Browse files Browse the repository at this point in the history
Phases calculation fix
  • Loading branch information
bassmaster187 authored Jun 25, 2024
2 parents 31a3739 + 3b58af1 commit cdf9d89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TeslaLogger/DBHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4932,7 +4932,7 @@ public static int CalculatePhases(int power, int voltage, int current)
if (power <= 0 || voltage <= 0 || current <= 0 )
return 0;

int phases = Convert.ToInt32(Math.Truncate((power * 1000.0 + 500) / voltage / current));
int phases = Convert.ToInt32(Math.Truncate(Math.Truncate((power * 1000.0 + 500) / voltage / current))+0.3);

if (phases > 3)
return 3;
Expand Down

0 comments on commit cdf9d89

Please sign in to comment.