(minValue, maxValue)
| 84 | return chosenStep |
| 85 | |
| 86 | def getDigitPlaces(minValue, maxValue): |
| 87 | minDigits = 3 |
| 88 | maxDigits = 5 |
| 89 | currentDecision = minDigits |
| 90 | for value in (floatUnerr(minValue), floatUnerr(maxValue)): |
| 91 | for currentDigit in range(minDigits, maxDigits + 1): |
| 92 | if round(value, currentDigit) == value: |
| 93 | if currentDigit > currentDecision: |
| 94 | currentDecision = currentDigit |
| 95 | break |
| 96 | # Max decimal places we can afford to show was not enough |
| 97 | else: |
| 98 | return maxDigits |
| 99 | return currentDecision |
| 100 | |
| 101 | self.ctrl = wx.SpinCtrlDouble(self, min=minValue, max=maxValue, inc=getStep(maxValue - minValue)) |
| 102 | self.ctrl.SetDigits(getDigitPlaces(minValue, maxValue)) |
nothing calls this directly
no test coverage detected