Skip to content

Commit c2beb8d

Browse files
committed
Fix rounding error by formatting net_string result
1 parent 295dc1d commit c2beb8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugwise/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ def power_data_energy_diff(measurement, net_string, f_val, direct_data):
211211
if isinstance(f_val, int):
212212
direct_data[net_string] += f_val * diff
213213
else:
214-
direct_data[net_string] += float(f_val * diff)
214+
direct_data[net_string] += float(f_val * diff)
215+
direct_data[net_string] = float(f"{round(direct_data[net_string], 3):.3f}")
215216

216217
return direct_data
217218

0 commit comments

Comments
 (0)