MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / to_eng_string

Method to_eng_string

tools/python-3.11.9-amd64/Lib/_pydecimal.py:1093–1100  ·  view source on GitHub ↗

Convert to a string, using engineering notation if an exponent is needed. Engineering notation has an exponent which is a multiple of 3. This can leave up to 3 digits to the left of the decimal place and may require the addition of either one or two trailing zeros.

(self, context=None)

Source from the content-addressed store, hash-verified

1091 return sign + intpart + fracpart + exp
1092
1093 def to_eng_string(self, context=None):
1094 """Convert to a string, using engineering notation if an exponent is needed.
1095
1096 Engineering notation has an exponent which is a multiple of 3. This
1097 can leave up to 3 digits to the left of the decimal place and may
1098 require the addition of either one or two trailing zeros.
1099 """
1100 return self.__str__(eng=True, context=context)
1101
1102 def __neg__(self, context=None):
1103 """Returns a copy with the sign switched.

Callers 1

to_eng_stringMethod · 0.45

Calls 1

__str__Method · 0.95

Tested by

no test coverage detected