diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-05-27 21:43:05 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-05-27 21:43:05 +0200 |
commit | 0eba00447e9e14415e1aa4834a03de0c5d221a1d (patch) | |
tree | 21b3841f9874958094f19b6a0dc65baf7ed9ce2d | |
parent | dd8e82f797f0c34a248837013925344aeab2c877 (diff) |
use real ParseMoney function to parse input to Send dialog
-rw-r--r-- | gui/src/sendcoinsdialog.cpp | 10 |
1 files 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 <QClipboard> #include <QMessageBox> #include <QLocale> +#include <QDebug> +#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(); |