Skip to content

Commit

Permalink
[core] Add adapting of price to step size
Browse files Browse the repository at this point in the history
  • Loading branch information
bigscoop committed Dec 13, 2024
1 parent 383a47d commit 7919249
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public BigDecimal adjustPrice(BigDecimal price, RoundingMode roundingMode) {
if (scale != null) {
result = result.setScale(scale, roundingMode);
}

BigDecimal stepSize = metaData.getPriceStepSize();
if (stepSize != null && stepSize.signum() != 0) {
result = BigDecimalUtils.roundToStepSize(result, stepSize, roundingMode);
}
return result;
}
}

0 comments on commit 7919249

Please sign in to comment.