Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #87389 > unrolled thread

Re: Odd ValueError using float

Started byChris Angelico <rosuav@gmail.com>
First post2015-03-14 09:14 +1100
Last post2015-03-14 09:14 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Odd ValueError using float Chris Angelico <rosuav@gmail.com> - 2015-03-14 09:14 +1100

#87389 — Re: Odd ValueError using float

FromChris Angelico <rosuav@gmail.com>
Date2015-03-14 09:14 +1100
SubjectRe: Odd ValueError using float
Message-ID<mailman.338.1426284851.21433.python-list@python.org>
On Sat, Mar 14, 2015 at 9:10 AM, emile <emile@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.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web