Changeset View
Changeset View
Standalone View
Standalone View
src/amount.cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Copyright (c) 2017-2018 The Bitcoin developers | // Copyright (c) 2017-2019 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <tinyformat.h> | #include <tinyformat.h> | ||||
const std::string CURRENCY_UNIT = "BCH"; | const std::string CURRENCY_UNIT = "BCH"; | ||||
std::string Amount::ToString() const { | std::string Amount::ToString() const { | ||||
return strprintf("%d.%08d %s", *this / COIN, (*this % COIN) / SATOSHI, | return strprintf("%d.%08d %s", *this / COIN, (*this % COIN) / SATOSHI, | ||||
CURRENCY_UNIT); | CURRENCY_UNIT); | ||||
} | } |