Skip to content

Commit

Permalink
fix alt form in format method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Kundert authored and Ken Kundert committed Mar 2, 2024
1 parent 6dc179d commit 3492579
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion quantiphy/quantiphy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2590,7 +2590,10 @@ def format(self, template=''):
ftype = ftype.lower()
if ftype in 's': # note that ftype = '' matches this case
label = label if ftype else None
value = self.render(prec=prec, show_label=label, scale=scale)
value = self.render(
prec=prec, show_label=label, scale=scale,
strip_zeros=not alt_form, strip_radix=not alt_form
)
elif ftype == 'q':
value = self.render(
form='si', prec=prec, show_units=True, show_label=label,
Expand Down

0 comments on commit 3492579

Please sign in to comment.