Skip to content

Commit

Permalink
Merge pull request #20 from nskeip/bug-19-numberbox-int-conversion
Browse files Browse the repository at this point in the history
Bug 19 numberbox int conversion
  • Loading branch information
nskeip authored Mar 6, 2022
2 parents c1cd084 + 1fcfdd2 commit bb6c9ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/spectrum/gui/gui_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ def refresh_input(self):
self._var.set(filtered)
else:
# remove any non-decimal character
value = int(''.join([c for c in self._var.get() if c in string.digits]))
str_value = ''.join([c for c in self._var.get() if c in string.digits])
if str_value:
value = int(str_value)
else:
value = 0

value = self._constraints.closest_valid(value)

Expand Down

0 comments on commit bb6c9ce

Please sign in to comment.