Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Classe « Decimal » Python 3.11.3

Méthode decimal.Decimal.to_eng_string

Signature de la méthode to_eng_string

def to_eng_string(self, /, context=None) 

Description

help(Decimal.to_eng_string)

Convert to an engineering-type string.  Engineering notation has an exponent
which is a multiple of 3, so there are up to 3 digits left of the decimal
place. For example, Decimal('123E+1') is converted to Decimal('1.23E+3').

The value of context.capitals determines whether the exponent sign is lower
or upper case. Otherwise, the context does not affect the operation.