[Tutor] Rounding a Python float to the nearest half integer
shantanoo at gmail.com
Mon Oct 11 10:52:27 CEST 2010
round(number[, ndigits]) -> floating point number
Round a number to a given precision in decimal digits (default 0
This always returns a floating point number. Precision may be negative.
On Mon, Oct 11, 2010 at 13:51, Sithembewena Lloyd Dube <zebra05 at gmail.com>wrote:
> Thanks everyone.
> On Fri, Oct 8, 2010 at 11:44 PM, Wayne Werner <waynejwerner at gmail.com>wrote:
>> On Fri, Oct 8, 2010 at 7:58 AM, Sithembewena Lloyd Dube <
>> zebra05 at gmail.com> 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.
> Sithembewena Lloyd Dube
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor