How do I format a scientific number into decimal format in Python?
Question: I'm having trouble trying to convert the results of my "def pricing(question)"
function into decimal values instead of scientific.

I tried converting the result to a string but that didn't work and I can't see
anyway of formatting the pricex variables where they are.

Any help is much appreciated

[Code](http://i.stack.imgur.com/9UmXK.png)

[![enter image description
here](http://i.stack.imgur.com/9UmXK.png)](http://i.stack.imgur.com/9UmXK.png)
[Result](http://i.stack.imgur.com/GzSHS.png)

[![enter image description
here](http://i.stack.imgur.com/GzSHS.png)](http://i.stack.imgur.com/GzSHS.png)


Answer: You need to use a formatting string.

    
    
    >>> import math
    >>> print(math.pi)
    3.141592653589793
    >>> print("{:.2f}".format(math.pi))
    3.14
    

