From ccb1f360837535f0567ba03da07f90f796a3f6e5 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Tue, 4 Sep 2018 11:15:40 +0200 Subject: [PATCH] Changed regex to support amount lines starting with a period, but block the transaction creation wizard --- pages/Transfer.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pages/Transfer.qml b/pages/Transfer.qml index c398eaf8..657a033c 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -162,7 +162,7 @@ Rectangle { inlineButton.onClicked: amountLine.text = "(all)" validator: RegExpValidator { - regExp: /(\d{1,8})([.]\d{1,12})?$/ + regExp: /(.|)(\d{1,8})([.]\d{1,12})?$/ } } } @@ -337,7 +337,12 @@ Rectangle { if(parseFloat(amountLine.text) > parseFloat(unlockedBalanceText)){ return false; } - + + // The amount does not start with a period (example: `.4`) + if(amountLine.text.startsWith('.')){ + return false; + } + return true; } onClicked: {