Skip to content

Commit

Permalink
Ruff updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jul 2, 2024
1 parent aa3a94e commit cae4163
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ lint.isort.known-first-party = [
lint.isort.required-imports = [
"from __future__ import annotations",
]
pydocstyle.convention = "google"
lint.pydocstyle.convention = "google"

[tool.pyproject-fmt]
max_supported_python = "3.13"
Expand Down
2 changes: 1 addition & 1 deletion src/humanize/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def scientific(value: NumberOrString, precision: int = 2) -> str:
return _format_not_finite(value)
except (ValueError, TypeError):
return str(value)
fmt = "{:.%se}" % str(int(precision))
fmt = f"{{:.{str(int(precision))}e}}"
n = fmt.format(value)
part1, part2 = n.split("e")
# Remove redundant leading '+' or '0's (preserving the last '0' for 10⁰).
Expand Down

0 comments on commit cae4163

Please sign in to comment.