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

Method reduce

python/ccxt/base/precise.py:153–167  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

151 return other.ge(self)
152
153 def reduce(self):
154 string = str(self.integer)
155 start = len(string) - 1
156 if start == 0:
157 if string == "0":
158 self.decimals = 0
159 return self
160 for i in range(start, -1, -1):
161 if string[i] != '0':
162 break
163 difference = start - i
164 if difference == 0:
165 return self
166 self.decimals -= difference
167 self.integer = int(string[:i + 1])
168
169 def equals(self, other):
170 self.reduce()

Callers 11

fetch_default_marketsMethod · 0.95
to_enMethod · 0.95
from_enMethod · 0.95
fetch_default_marketsMethod · 0.95
to_enMethod · 0.95
from_enMethod · 0.95
equalsMethod · 0.95
__str__Method · 0.95
from_precisionMethod · 0.95
from_enMethod · 0.95
compute_hash_on_elementsFunction · 0.45

Calls 1

rangeFunction · 0.50

Tested by

no test coverage detected