Odd ValueError using float

emile emile at fenx.com
Fri Mar 13 18:44:22 EDT 2015


On 03/13/2015 03:14 PM, Chris Angelico wrote:
> On Sat, Mar 14, 2015 at 9:10 AM, emile <emile at fenx.com> wrote:
>> (Pdb) decval
>> '4'
>> (Pdb) len(decval)
>> 1
>> (Pdb) int(decval)
>> *** ValueError: invalid literal for int() with base 10: '41.700000000000003'
>> (Pdb)
>>
>>
>> Any ideas?
>
> What's type(decval) tell you? I suspect you may have something other
> than a string, even though it looks like a string in its repr.

 >sigh<   Now it's running again.  Up to 20 minutes ago when I posted it 
continually.

Is-it-time-to-go-pick-grapes-yet?-ly y'rs,

Emile






More information about the Python-list mailing list