[Tutor] round so only see 2 digits

Sean 'Shaleh' Perry shalehperry@attbi.com
Sun, 03 Mar 2002 13:11:10 -0800 (PST)


On 03-Mar-2002 Ron wrote:
> How do I round a float so I will only see 2 digits after the decimal
> point or however many I want?
> 

The % operator takes the usual printf() arguments.  0.2%f means "unlimited
before decimal, 2 after".  I belive this is documented in the python docs
somewhere near the % operator.