From 22e4fdc3d052b51598332de2b5e64a3827ee17db Mon Sep 17 00:00:00 2001 From: Aruna Date: Wed, 27 Mar 2019 00:10:47 +0530 Subject: [PATCH] GUI decimal point error fixed Multiple decimal point issue is fixed now. Only accepts the initial decimal point others are ignored. recognizing the initial ".X" as "X." is fixed now. Now it takes the value as "0.X" --- visma/gui/window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/visma/gui/window.py b/visma/gui/window.py index 82b96e9..0af1fd8 100644 --- a/visma/gui/window.py +++ b/visma/gui/window.py @@ -578,6 +578,16 @@ def calluser(): elif name == 'DEL': cursor = self.textedit.textCursor() cursor.deletePreviousChar() + elif name == '.': + cursor = self.textedit.textCursor() + p = cursor.position() + preText = self.textedit.toPlainText()[:p] + if(preText == ""): + cursor.insertText("0.") + elif ('.' in preText): + pass + else: + cursor.insertText(".") else: self.textedit.insertPlainText(str(name)) return calluser