diff options
| author | tcatm <[email protected]> | 2011-03-05 17:24:34 +0100 |
|---|---|---|
| committer | tcatm <[email protected]> | 2011-03-05 17:24:34 +0100 |
| commit | 8e5aaada2e93e3a2f64135ece5ee09ad3d11cfe3 (patch) | |
| tree | e0bf81411e4b05210a95811d00ca8aa5939657a9 /util.cpp | |
| parent | Merge branch 'rounding' of https://github.com/gavinandresen/bitcoin-git into ... (diff) | |
| parent | throw JSONRPCError(-5, "Invalid bitcoin address") instead. (diff) | |
| download | discoin-8e5aaada2e93e3a2f64135ece5ee09ad3d11cfe3.tar.xz discoin-8e5aaada2e93e3a2f64135ece5ee09ad3d11cfe3.zip | |
Merge branch 'setaccountfix' of https://github.com/TheBlueMatt/bitcoin into TheBlueMatt-setaccountfix
Diffstat (limited to 'util.cpp')
| -rw-r--r-- | util.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -313,7 +313,12 @@ void ParseString(const string& str, char c, vector<string>& v) string FormatMoney(int64 n, bool fPlus) { - string str = strprintf("%.08f", double(n > 0 ? n : -n)/double(COIN)); + // Note: not using straight sprintf here because we do NOT want + // localized number formatting. + int64 n_abs = (n > 0 ? n : -n); + int64 quotient = n_abs/COIN; + int64 remainder = n_abs%COIN; + string str = strprintf("%"PRI64d".%08"PRI64d, quotient, remainder); // Right-trim excess 0's before the decimal point: int nTrim = 0; |