seanpedrickcase commited on
Commit
5cf0bc0
1 Parent(s): 115b61f

Updated time sum logging function to add correctly

Browse files
Files changed (1) hide show
  1. tools/helper_functions.py +2 -2
tools/helper_functions.py CHANGED
@@ -108,13 +108,13 @@ def sum_numbers_before_seconds(string):
108
  """
109
 
110
  # Extract numbers before 'seconds' using regular expression
111
- numbers = re.findall(r'\d+(\.\d+)?\s*seconds', string)
112
 
113
  # Extract the numbers from the matches
114
  numbers = [float(num.split()[0]) for num in numbers]
115
 
116
  # Sum up the extracted numbers
117
- sum_of_numbers = sum(numbers)
118
 
119
  return sum_of_numbers
120
 
 
108
  """
109
 
110
  # Extract numbers before 'seconds' using regular expression
111
+ numbers = re.findall(r'(\d+\.\d+)?\s*seconds', string)
112
 
113
  # Extract the numbers from the matches
114
  numbers = [float(num.split()[0]) for num in numbers]
115
 
116
  # Sum up the extracted numbers
117
+ sum_of_numbers = round(sum(numbers),1)
118
 
119
  return sum_of_numbers
120