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

Method parse_to_numeric

python/ccxt/base/exchange.py:3623–3631  ·  view source on GitHub ↗
(self, number)

Source from the content-addressed store, hash-verified

3621 return int(convertedNumber)
3622
3623 def parse_to_numeric(self, number):
3624 stringVersion = self.number_to_string(number) # self will convert 1.0 and 1 to "1" and 1.1 to "1.1"
3625 # keep self in mind:
3626 # in JS: 1 == 1.0 is True
3627 # in Python: 1 == 1.0 is True
3628 # in PHP: 1 == 1.0 is True, but 1 == 1.0 is False.
3629 if stringVersion.find('.') >= 0:
3630 return float(stringVersion)
3631 return int(stringVersion)
3632
3633 def is_round_number(self, value: float):
3634 # self method is similar to isInteger, but self is more loyal and does not check for types.

Callers 15

is_round_numberMethod · 0.95
parse_ledger_entryMethod · 0.80
cancel_twap_orderMethod · 0.80
cancel_orders_requestMethod · 0.80
fetch_orderMethod · 0.80
parse_marketMethod · 0.80
parse_marketMethod · 0.80
create_order_requestMethod · 0.80

Calls 1

findMethod · 0.80