Skip to content

Commit

Permalink
Improve display of k to avoid xxx + 0j
Browse files Browse the repository at this point in the history
Signed-off-by: Chipmuenk <mail@chipmuenk.de>
  • Loading branch information
chipmuenk committed Oct 17, 2017
1 parent fad88a3 commit ae2e34c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pyfda/input_widgets/filter_pz.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,13 @@ def _restore_gain(self, source = None):
self.zpk.append(1.) # use k = 1
else:
logger.error("P/Z list zpk has wrong length {0}".format(len(self.zpk)))


k = safe_eval(self.zpk[2], return_type='auto')

if not self.ui.ledGain.hasFocus(): # no focus, round the gain
self.ui.ledGain.setText(str(params['FMT'].format(self.zpk[2])))
self.ui.ledGain.setText(str(params['FMT'].format(k)))
else: # widget has focus, show gain with full precision
self.ui.ledGain.setText(str(self.zpk[2]))
self.ui.ledGain.setText(str(k))

#------------------------------------------------------------------------------
def _refresh_table_item(self, row, col):
Expand Down

0 comments on commit ae2e34c

Please sign in to comment.