Skip to content

Commit bc107b3

Browse files
authored
Fix time output template
3 decimal digits should fit even in the narrowest 'perhit' field
1 parent fc7c6b6 commit bc107b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

line_profiler/line_profiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,11 @@ def show_func(filename, start_lineno, func_name, timings, unit,
352352

353353
time_disp = '%5.1f' % (time * scalar)
354354
if len(time_disp) > default_column_sizes['time']:
355-
time_disp = '%5.1g' % (time * scalar)
355+
time_disp = '%5.3g' % (time * scalar)
356356

357357
perhit_disp = '%5.1f' % (float(time) * scalar / nhits)
358358
if len(perhit_disp) > default_column_sizes['perhit']:
359-
perhit_disp = '%5.1g' % (float(time) * scalar / nhits)
359+
perhit_disp = '%5.3g' % (float(time) * scalar / nhits)
360360

361361
nhits_disp = "%d" % nhits
362362
if len(nhits_disp) > default_column_sizes['hits']:

0 commit comments

Comments
 (0)