I borrowed this little scientific notation script from another poster: Display a decimal in scientific notation.
def format_e(n):
a = \'%E\' % n
return a
The interactive interpreter auto-echoes the results of any expression that doesn't return None
. In a script you need to explicitly print the results you want to see:
print format_e(Decimal('40800000000.00000000000000'))
print format_e(Decimal('40000000000.00000000000000'))
print format_e(Decimal('40812300000.00000000000000'))