Rounding

John Machin sjmachin at lexicon.net
Tue Dec 18 04:07:42 EST 2007


On Dec 18, 7:53 pm, "Vladimir Rusinov" <vladi... at greenmice.info>
wrote:
> On 12/15/07, katie smith <iceboy... at yahoo.com> wrote:
>
>
>
> > if i have a number 6.345 and i wanted it to be 6 without subtracting .345
> > because it won't always be .345 what do i do?
>
> > how do i round to the nearest whole number. Or in this case round down. Is
> > there an easy way to round down to the nearest whole number?
>
> init() ?

Perhaps you mean int. The OP may also be interested in another built-
in function, just in case a float result or more versatility is
needed; it's called round.






More information about the Python-list mailing list