forked from Public/monero-gui
Support comma seperator for amount field, dynamically change to dot. Fixes #2951
This commit is contained in:
@@ -296,6 +296,7 @@ Rectangle {
|
|||||||
inlineButtonText: qsTr("All") + translationManager.emptyString
|
inlineButtonText: qsTr("All") + translationManager.emptyString
|
||||||
inlineButton.onClicked: amountLine.text = "(all)"
|
inlineButton.onClicked: amountLine.text = "(all)"
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
|
amountLine.text = amountLine.text.replace(",", ".");
|
||||||
const match = amountLine.text.match(/^0+(\d.*)/);
|
const match = amountLine.text.match(/^0+(\d.*)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
const cursorPosition = amountLine.cursorPosition;
|
const cursorPosition = amountLine.cursorPosition;
|
||||||
@@ -311,7 +312,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validator: RegExpValidator {
|
validator: RegExpValidator {
|
||||||
regExp: /^(\d{1,8})?([\.]\d{1,12})?$/
|
regExp: /^(\d{1,8})?([\.,]\d{1,12})?$/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user