MCPcopy Index your code
hub / github.com/ccxt/ccxt / priceToPrecision

Method priceToPrecision

java/lib/src/main/java/io/github/ccxt/Exchange.java:11698–11711  ·  view source on GitHub ↗
(Object symbol, Object price)

Source from the content-addressed store, hash-verified

11696 }
11697
11698 public Object priceToPrecision(Object symbol, Object price)
11699 {
11700 if (Helpers.isTrue(Helpers.isEqual(price, null)))
11701 {
11702 return null;
11703 }
11704 Object market = this.market(symbol);
11705 Object result = this.decimalToPrecision(price, ROUND, Helpers.GetValue(Helpers.GetValue(market, "precision"), "price"), this.precisionMode, this.paddingMode);
11706 if (Helpers.isTrue(Helpers.isEqual(result, "0")))
11707 {
11708 throw new InvalidOrder((String)Helpers.add(Helpers.add(Helpers.add(Helpers.add(this.id, " price of "), Helpers.GetValue(market, "symbol")), " must be greater than minimum price precision of "), this.numberToString(Helpers.GetValue(Helpers.GetValue(market, "precision"), "price")))) ;
11709 }
11710 return result;
11711 }
11712
11713 public Object amountToPrecision(Object symbol, Object amount)
11714 {

Callers 1

Calls 7

isTrueMethod · 0.95
isEqualMethod · 0.95
marketMethod · 0.95
decimalToPrecisionMethod · 0.95
GetValueMethod · 0.95
addMethod · 0.95
numberToStringMethod · 0.95

Tested by

no test coverage detected