Changeset View
Changeset View
Standalone View
Standalone View
src/feerate.cpp
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | Amount CFeeRate::GetFee(size_t nBytes) const { | ||||
return ::GetFee<false>(nBytes, nSatoshisPerK); | return ::GetFee<false>(nBytes, nSatoshisPerK); | ||||
} | } | ||||
Amount CFeeRate::GetFeeCeiling(size_t nBytes) const { | Amount CFeeRate::GetFeeCeiling(size_t nBytes) const { | ||||
return ::GetFee<true>(nBytes, nSatoshisPerK); | return ::GetFee<true>(nBytes, nSatoshisPerK); | ||||
} | } | ||||
std::string CFeeRate::ToString() const { | std::string CFeeRate::ToString() const { | ||||
return strprintf("%d.%08d %s/kB", nSatoshisPerK / COIN, | const auto currency = Currency::get(); | ||||
(nSatoshisPerK % COIN) / SATOSHI, CURRENCY_UNIT); | return strprintf( | ||||
"%d.%0*d %s/kB", nSatoshisPerK / currency.baseunit, currency.decimals, | |||||
(nSatoshisPerK % currency.baseunit) / currency.subunit, CURRENCY_UNIT); | |||||
} | } |