Skip to content

Commit 00ec2d7

Browse files
authored
Merge pull request #4980 from bigscoop/price-stepsize
[core] Add adapting of price to step size
2 parents 383a47d + 7919249 commit 00ec2d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

xchange-core/src/main/java/org/knowm/xchange/utils/OrderValuesHelper.java

+5
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ public BigDecimal adjustPrice(BigDecimal price, RoundingMode roundingMode) {
9090
if (scale != null) {
9191
result = result.setScale(scale, roundingMode);
9292
}
93+
94+
BigDecimal stepSize = metaData.getPriceStepSize();
95+
if (stepSize != null && stepSize.signum() != 0) {
96+
result = BigDecimalUtils.roundToStepSize(result, stepSize, roundingMode);
97+
}
9398
return result;
9499
}
95100
}

0 commit comments

Comments
 (0)