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

Method safe_integer_product_2

python/ccxt/base/exchange.py:875–882  ·  view source on GitHub ↗
(dictionary, key1, key2, factor, default_value=None)

Source from the content-addressed store, hash-verified

873
874 @staticmethod
875 def safe_integer_product_2(dictionary, key1, key2, factor, default_value=None):
876 try:
877 return int(float(dictionary[key1]) * factor)
878 except Exception:
879 try:
880 return int(float(dictionary[key2]) * factor)
881 except Exception:
882 return default_value
883
884 @staticmethod
885 def safe_timestamp_2(dictionary, key1, key2, default_value=None):

Callers 15

test_safe_methodsFunction · 0.95
parse_uta_orderMethod · 0.80
parse_transactionMethod · 0.80
parse_orderMethod · 0.80
parse_tradeMethod · 0.80
parse_orderMethod · 0.80
parse_spot_orderMethod · 0.80
parse_uta_orderMethod · 0.80
parse_transactionMethod · 0.80
parse_orderMethod · 0.80
parse_tradeMethod · 0.80
parse_orderMethod · 0.80

Calls

no outgoing calls

Tested by 1

test_safe_methodsFunction · 0.76