Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from decimal import Decimal
- def format(n):
- p = 0
- while n <= -1 or n >= 1:
- n /= Decimal(10.0)
- p += 1
- return "{:.30f}E{:+5d}".format(n, p)
- a = Decimal('123123123.123123123E99999')
- print( format( a ) )
Advertisement
Add Comment
Please, Sign In to add comment