From 4dd4dd458c4e0338f26ef02156948c87b9e378c1 Mon Sep 17 00:00:00 2001 From: "Alex H. Room" <69592136+alexhroom@users.noreply.github.com> Date: Tue, 1 Oct 2024 07:22:58 +0100 Subject: [PATCH] made spinbox less erratic (#36) --- rascal2/widgets/inputs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rascal2/widgets/inputs.py b/rascal2/widgets/inputs.py index 39b7033..b69b3aa 100644 --- a/rascal2/widgets/inputs.py +++ b/rascal2/widgets/inputs.py @@ -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.