We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4850596 commit 723efcaCopy full SHA for 723efca
1 file changed
python_utils/formatters.py
@@ -161,11 +161,11 @@ def timesince(
161
162
output: types.List[str] = []
163
for period, singular, plural in periods:
164
- if int(period):
165
- if int(period) == 1:
166
- output.append(f'{period:d} {singular}')
167
- else:
168
- output.append(f'{period:d} {plural}')
+ int_period = int(period)
+ if int_period == 1:
+ output.append(f'{int_period} {singular}')
+ elif int_period:
+ output.append(f'{int_period} {plural}')
169
170
if output:
171
return f'{" and ".join(output[:2])} ago'
0 commit comments