Skip to content

Commit

Permalink
Used AS's Precision in importer
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejmets committed Oct 18, 2024
1 parent a5a45a0 commit 7d9dce0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/senaite/timeseries/importer/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def parse_headerline(self, line):
return 0

def format_values(self, result):
precision = self._analysis_service.Precision
float_fmt = "{:0." + str(precision) + "f}"
formatted = []
for value in result:
try:
Expand All @@ -78,7 +80,7 @@ def format_values(self, result):
pass
try:
value = float(value)
value = "{:0.2f}".format(value)
value = float_fmt.format(value)
formatted.append(value)
continue
except Exception:
Expand Down

0 comments on commit 7d9dce0

Please sign in to comment.