mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Expand LoanPay test cases, and fix rounding errors
- At least rounding errors for a full payoff
This commit is contained in:
@@ -697,12 +697,14 @@ getRate(STAmount const& offerOut, STAmount const& offerIn);
|
||||
|
||||
template <AssetType A>
|
||||
Number
|
||||
roundToAsset(A const& asset, Number const& value)
|
||||
roundToAsset(
|
||||
A const& asset,
|
||||
Number const& value,
|
||||
Number::rounding_mode rounding = Number::getround())
|
||||
{
|
||||
NumberRoundModeGuard mg(rounding);
|
||||
STAmount const amount{asset, value};
|
||||
if (amount != value)
|
||||
return amount;
|
||||
return value;
|
||||
return amount;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user