===
round(...)
round(number[, ndigits]) -> floating point number
Round a number to a given precision in decimal digits (default 0
digits).
This always returns a floating point number. Precision may be negative.
===
>>> round(1.23423,2)
1.23
>>> round(1.23623,2)
1.24
HTH.
On Mon, Oct 11, 2010 at 13:51, Sithembewena Lloyd Dube <[email protected]>wrote:
> Thanks everyone.
>
>
> On Fri, Oct 8, 2010 at 11:44 PM, Wayne Werner <[email protected]>wrote:
>
>> On Fri, Oct 8, 2010 at 7:58 AM, Sithembewena Lloyd Dube <
>> [email protected]> wrote:
>>
>>> I realise that one cannot have a half integer :) I meant how would one
>>> round off to the first decimal nearest to either 0.5, or a whole number.
>>>
>>> Ugh...does anyone get what I'm trying to articulate? :)
>>
>>
>> sample input/output cases are always useful.
>>
>> -Wayne
>>
>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
> http://www.lloyddube.com
>
> _______________________________________________
> Tutor maillist - [email protected]
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor