From 1c895a593d65723df9bfd5292ba54d6cf996e115 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 11 Apr 2012 14:59:31 -0700 Subject: [PATCH] Sync. --- src/Amount.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Amount.cpp b/src/Amount.cpp index 6d881c1fd..0edb6bd44 100644 --- a/src/Amount.cpp +++ b/src/Amount.cpp @@ -58,6 +58,11 @@ STAmount* STAmount::construct(SerializerIterator& sit, const char *name) return new STAmount(name, value, offset); } +std::string STAmount::getRaw() const +{ // show raw internal form + return boost::lexical_cast(value) + "e" + boost::lexical_cast(offset); +} + std::string STAmount::getText() const { if (value == 0) return "0"; @@ -246,7 +251,7 @@ STAmount operator*(const STAmount &v1, const STAmount &v2) // Compute (numerator*10 * denominator*10) / 10^18 CBigNum v; if ((BN_add_word(&v, (v1.value*10) + 3) != 1) || - (BN_mul_word(&v, (v2.value*10) + 3) != 1) || + (BN_mul_word(&v, (v2.value*10) + 3) != 1) || (BN_div_word(&v, 1000000000000000000ull) == ((BN_ULONG)-1))) { throw std::runtime_error("internal bn error");