MCPcopy Index your code
hub / github.com/python/cpython / to_sci_string

Method to_sci_string

Lib/_pydecimal.py:5525–5531  ·  view source on GitHub ↗

Converts a number to a string, using scientific notation. The operation is not affected by the context.

(self, a)

Source from the content-addressed store, hash-verified

5523 return a.to_eng_string(context=self)
5524
5525 def to_sci_string(self, a):
5526 """Converts a number to a string, using scientific notation.
5527
5528 The operation is not affected by the context.
5529 """
5530 a = _convert_other(a, raiseit=True)
5531 return a.__str__(context=self)
5532
5533 def to_integral_exact(self, a):
5534 """Rounds to an integer.

Callers 2

test_to_sci_stringMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
__str__Method · 0.45

Tested by 2

test_to_sci_stringMethod · 0.76