Python format function: 1 decimal place

Viewed 10830

I have the following:

'{0:n}'.format(0/10.0)

which evaluates to

0

I want it to evaluate to

0.0

That is, there should always be 1 decimal place. What is the correct format for this?

Thanks.

3 Answers
Related