Skip to content

Commit

Permalink
Fixed number of digits in the ControlSlider knob.
Browse files Browse the repository at this point in the history
  • Loading branch information
belangeo committed Sep 4, 2018
1 parent afec3c2 commit dc9740e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyolib/_wxwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,13 @@ def OnPaint(self, evt):
if self.integer:
val = '%d' % self.GetValue()
elif abs(self.GetValue()) >= 1000:
val = '%.1f' % self.GetValue()
val = '%.0f' % self.GetValue()
elif abs(self.GetValue()) >= 100:
val = '%.2f' % self.GetValue()
val = '%.1f' % self.GetValue()
elif abs(self.GetValue()) >= 10:
val = '%.3f' % self.GetValue()
val = '%.2f' % self.GetValue()
elif abs(self.GetValue()) < 10:
val = '%.4f' % self.GetValue()
val = '%.3f' % self.GetValue()
if sys.platform.startswith('linux'):
width = len(val) * (dc.GetCharWidth() - 3)
else:
Expand Down

0 comments on commit dc9740e

Please sign in to comment.