Skip to content

Commit

Permalink
fix pint's unicode printing of ohms
Browse files Browse the repository at this point in the history
  • Loading branch information
bqpd committed Oct 1, 2019
1 parent fdde461 commit e44f232
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gpkit/repr_conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def unitstr(units, into="%s", options=UNIT_FORMATTING, dimless=""):
units = units.units
if not isinstance(units, Quantity):
return dimless
rawstr = ("{%s}" % options).format(units.units)
if options == ":~" and "ohm" in str(units.units):
rawstr = "ohm" # otherwise it'll be a capital Omega
else:
rawstr = ("{%s}" % options).format(units.units)
units = rawstr.replace(" ", "").replace("dimensionless", dimless)
return into % units or dimless

Expand Down

0 comments on commit e44f232

Please sign in to comment.