Skip to content

Commit

Permalink
Create function to join magnitude and units that deal with 3 1 / s
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrecco committed Jan 19, 2024
1 parent a1eee0a commit aba62bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pint/delegates/formatter/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,9 @@ def split_format(
uspec = uspec or default_uspec

return mspec, uspec


def join_mu(joint_fstring: str, mstr: str, ustr: str) -> str:
if ustr.startswith("1 / "):
return joint_fstring.format(mstr, ustr[2:])
return joint_fstring.format(mstr, ustr)

0 comments on commit aba62bb

Please sign in to comment.