There are tons of topics on here that explain how to convert a string to a decimal, but how do I convert a decimal back to a string?
Like if I did this:
Use the string format function:
>>> from decimal import Decimal >>> d = Decimal("0.0000000000000123123") >>> s = '{0:f}'.format(d) >>> print(s) 0.0000000000000123123
If you just type cast the number to a string it won't work for exponents:
>>> str(d) '1.23123E-14'