File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,6 @@ def in_words(
242
242
self ,
243
243
locale : str | None = None ,
244
244
separator : str = " " ,
245
- seconds_n_decimal : int = 2 ,
246
245
) -> str :
247
246
"""
248
247
Get the current interval in words in the current locale.
@@ -251,9 +250,6 @@ def in_words(
251
250
252
251
:param locale: The locale to use. Defaults to current locale.
253
252
:param separator: The separator to use between each unit
254
- :param kwargs: Additional keyword arguments.
255
- - seconds_n_decimal (int): The number of decimal places to use for seconds if no other time units are present. Defaults to 2.
256
-
257
253
"""
258
254
intervals = [
259
255
("year" , self .years ),
@@ -281,10 +277,11 @@ def in_words(
281
277
282
278
if not parts :
283
279
count : int | str = 0
284
- unit = f"units.second. { loaded_locale . plural ( 0 ) } "
280
+ unit : str
285
281
if self .microseconds != 0 :
282
+ unit = f"units.second.{ loaded_locale .plural (0 )} "
286
283
microseconds = abs (self .microseconds ) / 1e6
287
- count = str ({ round ( microseconds , ndigits = seconds_n_decimal )})
284
+ count = f" { abs ( self . microseconds ) / 1e6 :.2f } "
288
285
else :
289
286
unit = f"units.microsecond.{ loaded_locale .plural (0 )} "
290
287
translation = loaded_locale .translation (unit )
You can’t perform that action at this time.
0 commit comments