From af05698ef96a71659c84efebd195c06653ec590d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 14 Aug 2014 14:45:13 +0200 Subject: [PATCH] Minor fix for JS API. --- libqethereum/QEthereum.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libqethereum/QEthereum.h b/libqethereum/QEthereum.h index f57f40bf6..b145da59a 100644 --- a/libqethereum/QEthereum.h +++ b/libqethereum/QEthereum.h @@ -73,12 +73,12 @@ inline QString toDecimal(QString const& _s) return QString::fromStdString(eth::toString(toU256(_s))); } -inline double toFixed(QString const& _s) +inline double fromFixed(QString const& _s) { return (double)toU256(_s) / (double)(eth::u256(1) << 128); } -inline QString fromFixed(double _s) +inline QString toFixed(double _s) { return toQJS(eth::u256(_s * (double)(eth::u256(1) << 128))); } @@ -130,8 +130,8 @@ public: Q_INVOKABLE QString fromAscii(QString _s) const { return ::fromBinary(_s, 32); } Q_INVOKABLE QString fromAscii(QString _s, unsigned _padding) const { return ::fromBinary(_s, _padding); } Q_INVOKABLE QString toDecimal(QString _s) const { return ::toDecimal(_s); } - Q_INVOKABLE double toFixed(QString _s) const { return ::toFixed(_s); } - Q_INVOKABLE QString fromFixed(double _d) const { return ::fromFixed(_d); } + Q_INVOKABLE double fromFixed(QString _s) const { return ::fromFixed(_s); } + Q_INVOKABLE QString toFixed(double _d) const { return ::toFixed(_d); } // [NEW API] - Use this instead. Q_INVOKABLE QString/*eth::u256*/ balanceAt(QString/*eth::Address*/ _a, int _block) const;