--- Kent Johnson <[EMAIL PROTECTED]> wrote:
> Toon Pieton wrote:
> > Hey all!
> >
> > My memory seem to have a horrible leak. How does
> one limit the amount of
> > decimal spaces for a float? I used to know that...
> >
> > Example: not 5.398042156, but 5.4 (if I decide to
> have only one plac
Toon Pieton wrote:
> Hey all!
>
> My memory seem to have a horrible leak. How does one limit the amount of
> decimal spaces for a float? I used to know that...
>
> Example: not 5.398042156, but 5.4 (if I decide to have only one place).
For printing, use %.1f :
In [2]: print '%.1f' % 5.39804215
Hey all!
My memory seem to have a horrible leak. How does one limit the amount of
decimal spaces for a float? I used to know that...
Example: not 5.398042156, but 5.4 (if I decide to have only one place).
Thanks in advance!
Toon Pieton.
___
Tutor maill
Toon Pieton wrote:
> Hey all!
>
> My memory seem to have a horrible leak. How does one limit the amount
> of decimal spaces for a float? I used to know that...
>
> Example: not 5.398042156, but 5.4 (if I decide to have only one place).
Usually you do this during display, while you leave the actual