MCPcopy Create free account
hub / github.com/ccxt/ccxt / get_amount

Method get_amount

python/ccxt/async_support/bybit.py:1647–1655  ·  view source on GitHub ↗
(self, symbol: str, amount: float)

Source from the content-addressed store, hash-verified

1645 return [subType, params]
1646
1647 def get_amount(self, symbol: str, amount: float):
1648 # some markets like options might not have the precision available
1649 # and we shouldn't crash in those cases
1650 market = self.market(symbol)
1651 emptyPrecisionAmount = (market['precision']['amount'] is None)
1652 amountString = self.number_to_string(amount)
1653 if not emptyPrecisionAmount and (amountString != '0'):
1654 return self.amount_to_precision(symbol, amount)
1655 return amountString
1656
1657 def get_price(self, symbol: str, price: str):
1658 if price is None:

Callers 2

create_order_requestMethod · 0.95
edit_order_requestMethod · 0.95

Calls 2

marketMethod · 0.45
amount_to_precisionMethod · 0.45

Tested by

no test coverage detected