From 0eba00447e9e14415e1aa4834a03de0c5d221a1d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 27 May 2011 21:43:05 +0200 Subject: [PATCH] use real ParseMoney function to parse input to Send dialog --- gui/src/sendcoinsdialog.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gui/src/sendcoinsdialog.cpp b/gui/src/sendcoinsdialog.cpp index 3907b4bc59..123b930a20 100644 --- a/gui/src/sendcoinsdialog.cpp +++ b/gui/src/sendcoinsdialog.cpp @@ -8,7 +8,9 @@ #include #include #include +#include +#include "util.h" #include "base58.h" SendCoinsDialog::SendCoinsDialog(QWidget *parent, const QString &address) : @@ -42,7 +44,7 @@ void SendCoinsDialog::on_sendButton_clicked() { QByteArray payTo = ui->payTo->text().toUtf8(); uint160 payToHash = 0; - double payAmount = 0.0; + int64 payAmount = 0.0; bool valid = false; if(!AddressToHash160(payTo.constData(), payToHash)) @@ -54,8 +56,9 @@ void SendCoinsDialog::on_sendButton_clicked() ui->payTo->setFocus(); return; } - payAmount = QLocale::system().toDouble(ui->payAmount->text(), &valid); - if(!valid || payAmount <= 0.0) + valid = ParseMoney(ui->payAmount->text().toStdString(), payAmount); + + if(!valid || payAmount <= 0) { QMessageBox::warning(this, tr("Warning"), tr("The amount to pay must be a valid number larger than 0."), @@ -64,6 +67,7 @@ void SendCoinsDialog::on_sendButton_clicked() ui->payAmount->setFocus(); return; } + qDebug() << "Pay " << payAmount; /* TODO: send command to core, once this succeeds do accept() */ accept();