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

Method integer_precision_to_amount

python/ccxt/base/exchange.py:6865–6882  ·  view source on GitHub ↗

@ignore handles positive & negative numbers too. parsePrecision() does not handle negative numbers, but self method handles :param str precision: The number of digits to the right of the decimal :returns str: a string number equal to 1e-precision

(self, precision: Str)

Source from the content-addressed store, hash-verified

6863 return parsedPrecision + '0'
6864
6865 def integer_precision_to_amount(self, precision: Str):
6866 """
6867 @ignore
6868 handles positive & negative numbers too. parsePrecision() does not handle negative numbers, but self method handles
6869 :param str precision: The number of digits to the right of the decimal
6870 :returns str: a string number equal to 1e-precision
6871 """
6872 if precision is None:
6873 return None
6874 if Precise.string_ge(precision, '0'):
6875 return self.parse_precision(precision)
6876 else:
6877 positivePrecisionString = Precise.string_abs(precision)
6878 positivePrecision = int(positivePrecisionString)
6879 parsedPrecision = '1'
6880 for i in range(0, positivePrecision - 1):
6881 parsedPrecision = parsedPrecision + '0'
6882 return parsedPrecision + '0'
6883
6884 def load_time_difference(self, params={}):
6885 serverTime = self.fetch_time(params)

Callers 2

fetch_marketsMethod · 0.80
fetch_marketsMethod · 0.80

Calls 4

parse_precisionMethod · 0.95
string_geMethod · 0.80
string_absMethod · 0.80
rangeFunction · 0.50

Tested by

no test coverage detected