Problems with conversion of values in strings to integers
Karl Scalet
news at yebu.de
Tue Oct 7 04:20:10 EDT 2003
Erik Max Francis wrote:
> Karl Scalet wrote:
>
>
>>depending on what you actually want,
>> >>> int(round('10.1'))
>>might be appropriate.
>>But if you really want the "floor"-value,
>>nothing is wrong with your approach.
>
>
> round actually takes a float as an argument, not a string, so you
> probably meant
>
> int(round(float('10.1')))
>
yes, of course, sorry
Karl
More information about the Python-list
mailing list