Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ lint.select = [
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PERF", # perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PT", # flake8-pytest-style
Expand Down
9 changes: 2 additions & 7 deletions src/humanize/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,9 @@ def scientific(value: NumberOrString, precision: int = 2) -> str:
import re

part2 = re.sub(r"^\+?(\-?)0*(.+)$", r"\1\2", part2)
part2_list = [exponents[char] for char in part2]

new_part2 = []
for char in part2:
new_part2.append(exponents[char])

final_str = part1 + " x 10" + "".join(new_part2)

return final_str
return part1 + " x 10" + "".join(part2_list)


def clamp(
Expand Down
Loading