Skip to content

Commit 2935cc8

Browse files
authored
Merge pull request #11 from ant9000/master
fix: unknown VRate raises exception
2 parents 2a86b4c + 7d94fee commit 2935cc8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ecg/ecg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,14 @@ def legend(self):
357357
vrate = float(ecgdata.get('VRate'))
358358
except (TypeError, ValueError):
359359
try:
360-
vrate = (
360+
vrate = "%.1f" % (
361361
60.0 / self.duration *
362362
self.samples / float(ecgdata.get('RR Interval'))
363363
)
364364
except (TypeError, ValueError, ZeroDivisionError):
365365
vrate = "(unknown)"
366366

367-
ret_str = "%s: %.1f BPM\n" % (i18n.ventr_freq, vrate)
367+
ret_str = "%s: %s BPM\n" % (i18n.ventr_freq, vrate)
368368
ret_str_tmpl = "%s: %s ms\n%s: %s ms\n%s: %s/%s ms\n%s: %s %s %s"
369369

370370
ret_str += ret_str_tmpl % (

0 commit comments

Comments
 (0)