20 #ifndef RIPPLE_PROTOCOL_AMOUNTCONVERSION_H_INCLUDED
21 #define RIPPLE_PROTOCOL_AMOUNTCONVERSION_H_INCLUDED
23 #include <ripple/basics/IOUAmount.h>
24 #include <ripple/basics/XRPAmount.h>
25 #include <ripple/protocol/STAmount.h>
32 bool const isNeg = iou.
signum() < 0;
52 bool const isNeg = xrp.
signum() < 0;
66 toAmount(STAmount
const& amt) =
delete;
103 toAmount(IOUAmount
const& amt) =
delete;
114 toAmount(XRPAmount
const& amt) =
delete;
123 template <
typename T>
133 if constexpr (std::is_same_v<IOUAmount, T>)
135 if constexpr (std::is_same_v<XRPAmount, T>)
137 if constexpr (std::is_same_v<STAmount, T>)
154 template <
typename T>
158 if constexpr (std::is_same_v<IOUAmount, T>)
160 if constexpr (std::is_same_v<XRPAmount, T>)
162 if constexpr (std::is_same_v<STAmount, T>)
166 template <
typename T>
170 if constexpr (std::is_same_v<IOUAmount, T>)
172 if constexpr (std::is_same_v<XRPAmount, T>)
174 if constexpr (std::is_same_v<STAmount, T>)
int exponent() const noexcept
static rounding_mode getround()
A currency issued by an account.
std::uint64_t mantissa() const noexcept
constexpr value_type drops() const
Returns the number of drops.
constexpr int exponent() const noexcept
Issue const & noIssue()
Returns an asset specifier that represents no account and currency.
T toAmount(STAmount const &amt)=delete
Floating point representation of amounts with high dynamic range.
IOUAmount toAmount< IOUAmount >(STAmount const &amt)
int signum() const noexcept
Return the sign of the amount.
int exponent() const noexcept
XRPAmount toAmount< XRPAmount >(STAmount const &amt)
Issue getIssue(T const &amt)
static rounding_mode setround(rounding_mode mode)
STAmount toSTAmount(IOUAmount const &iou, Issue const &iss)
bool isXRP(AccountID const &c)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::int64_t mantissa() const noexcept
bool negative() const noexcept
Issue const & xrpIssue()
Returns an asset specifier that represents XRP.
constexpr rep mantissa() const noexcept
STAmount toAmount< STAmount >(STAmount const &amt)
constexpr int signum() const noexcept
Return the sign of the amount.
T & get(EitherAmount &amt)