Skip to content

Commit

Permalink
Merge pull request #4980 from bigscoop/price-stepsize
Browse files Browse the repository at this point in the history
[core] Add adapting of price to step size
  • Loading branch information
timmolter authored Dec 13, 2024
2 parents 383a47d + 7919249 commit 00ec2d7
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 00ec2d7

Please sign in to comment.