Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Parse units correctly #42

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from 2 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
4 changes: 3 additions & 1 deletion src/api/console_stringifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def _modify_unit(self, unit: str) -> str:
Returns the modified unit.
"""
unit = (
unit.replace(r"\squared", "^2")
unit.replace(" ", "")
.replace(r"\squared", "^2")
.replace(r"\cubed", "^3")
.replace("\\percent", "\\%")
.replace("\\per\\", "/")
.replace(r"\per", "/")
.replace("\\", " ")
Expand Down