diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-10-01 11:28:51 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-10-01 11:28:55 +0200 |
| commit | 3fd192f8b4d6db386354dfe635a8a6a105b55de8 (patch) | |
| tree | 39f8a9caf006a6fe38d89b98a57fb94c56f3cd28 /src/utilmoneystr.cpp | |
| parent | Merge pull request #5008 (diff) | |
| parent | qt: Register CAmount metatype (diff) | |
| download | discoin-3fd192f8b4d6db386354dfe635a8a6a105b55de8.tar.xz discoin-3fd192f8b4d6db386354dfe635a8a6a105b55de8.zip | |
Merge pull request #4234
c122f55 qt: Register CAmount metatype (Wladimir J. van der Laan)
a372168 Use a typedef for monetary values (Mark Friedenbach)
Diffstat (limited to 'src/utilmoneystr.cpp')
| -rw-r--r-- | src/utilmoneystr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utilmoneystr.cpp b/src/utilmoneystr.cpp index c169355f0..1a5635bfb 100644 --- a/src/utilmoneystr.cpp +++ b/src/utilmoneystr.cpp @@ -10,7 +10,7 @@ using namespace std; -string FormatMoney(int64_t n, bool fPlus) +string FormatMoney(const CAmount& n, bool fPlus) { // Note: not using straight sprintf here because we do NOT want // localized number formatting. @@ -34,12 +34,12 @@ string FormatMoney(int64_t n, bool fPlus) } -bool ParseMoney(const string& str, int64_t& nRet) +bool ParseMoney(const string& str, CAmount& nRet) { return ParseMoney(str.c_str(), nRet); } -bool ParseMoney(const char* pszIn, int64_t& nRet) +bool ParseMoney(const char* pszIn, CAmount& nRet) { string strWhole; int64_t nUnits = 0; @@ -73,7 +73,7 @@ bool ParseMoney(const char* pszIn, int64_t& nRet) if (nUnits < 0 || nUnits > COIN) return false; int64_t nWhole = atoi64(strWhole); - int64_t nValue = nWhole*COIN + nUnits; + CAmount nValue = nWhole*COIN + nUnits; nRet = nValue; return true; |