mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
Correct ruff failures (#8732)
* fix: Correct ruff problems * updating DIRECTORY.md * fix: Fix pre-commit errors * updating DIRECTORY.md --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
793e564e1d
commit
1faf10b5c2
@ -96,7 +96,7 @@ def add_si_prefix(value: float) -> str:
|
||||
for name_prefix, value_prefix in prefixes.items():
|
||||
numerical_part = value / (10**value_prefix)
|
||||
if numerical_part > 1:
|
||||
return f"{str(numerical_part)} {name_prefix}"
|
||||
return f"{numerical_part!s} {name_prefix}"
|
||||
return str(value)
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ def add_binary_prefix(value: float) -> str:
|
||||
for prefix in BinaryUnit:
|
||||
numerical_part = value / (2**prefix.value)
|
||||
if numerical_part > 1:
|
||||
return f"{str(numerical_part)} {prefix.name}"
|
||||
return f"{numerical_part!s} {prefix.name}"
|
||||
return str(value)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user