Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2009-2010 Satoshi Nakamoto2// Copyright (c) 2009-present The Bitcoin Core developers3// Distributed under the MIT software license, see the accompanying4// file COPYING or http://www.opensource.org/licenses/mit-license.php.6/**7* Money parsing/formatting utilities.8*/9#ifndef BITCOIN_UTIL_MONEYSTR_H10#define BITCOIN_UTIL_MONEYSTR_H12#include <consensus/amount.h>14#include <optional>15#include <string>17/* Do not use these functions to represent or parse monetary amounts to or from18* JSON but use AmountFromValue and ValueFromAmount for that.19*/20std::string FormatMoney(CAmount n);21/** Parse an amount denoted in full coins. E.g. "0.0034" supplied on the command line. **/22std::optional<CAmount> ParseMoney(const std::string& str);24#endif // BITCOIN_UTIL_MONEYSTR_H