bject: Re: [IronPython] System.Convert Problem
If you're trying to convert strings to ints in IronPython, the pythonic
way of doing it would be to use the built-in "int":
>>> int("A")
Traceback (most recent call last):
File "", line 1, in ?
ValueError:
("A", 16)
10
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Davy Mitchell
Sent: Friday, March 10, 2006 3:10 PM
To: Discussion of IronPython
Subject: Re: [IronPython] System.Convert Problem
On 3/10/06, Ernst, Nathan <[EMAIL PROTECTED]> wrot
On 3/10/06, Ernst, Nathan <[EMAIL PROTECTED]> wrote:
> This makes perfect sense. "A" cannot be converted to an integer -
> unless you specify a base, e.g. 16 to treat this as a hex digit.
Thanks for the quick response Nathan. It now makes sense to me too :-)
BTW I switched from System.Convert to
cussion of IronPython
Subject: [IronPython] System.Convert Problem
Hi Folks,
I am trying to get the following to work:
print Convert.ToInt32('A')
An error is thrown complaining:
Input string was not in a correct format.
Full stack trace below.
Have a great weekend!
Thanks,
Davy Mitche
Hi Folks,
I am trying to get the following to work:
print Convert.ToInt32('A')
An error is thrown complaining:
Input string was not in a correct format.
Full stack trace below.
Have a great weekend!
Thanks,
Davy Mitchell
Mood News
- BBC News Headlines Auto-Classified as Good, Bad or