Skip to content

Commit

Permalink
made spinbox less erratic (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhroom authored Oct 1, 2024
1 parent 23cfcbd commit 4dd4dd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rascal2/widgets/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def textFromValue(self, value):
The string displayed on the spinbox.
"""
return f"{value:.{self.decimals()}g}"
return f"{round(value, self.decimals()):.{self.decimals()}g}"

def validate(self, input, pos) -> tuple[QtGui.QValidator.State, str, int]:
"""Validate a string written into the spinbox.
Expand Down

0 comments on commit 4dd4dd4

Please sign in to comment.