Skip to content

Commit

Permalink
Removed unnecessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
olivergregorius authored Apr 3, 2024
1 parent 74cc685 commit 0f4f125
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sun2000_modbus/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ def read(self, register):
else:
return raw_value / register.value.gain

def read_formatted(self, register, use_locale=False): # added the last argument.
def read_formatted(self, register, use_locale=False):
value = self.read(register)

if register.value.unit is not None:
if use_locale:
return f'{value:n} {register.value.unit}' # added :n to format number according to the locale.
return f'{value:n} {register.value.unit}'
else:
return f'{value} {register.value.unit}'
elif register.value.mapping is not None:
Expand Down

0 comments on commit 0f4f125

Please sign in to comment.