Quantcast
Channel: int.Parse oddity
Browsing all 15 articles
Browse latest View live

int.Parse oddity

 Speedbird186 wrote:The .NET 2.0 Class Lib referencehttp://msdn2.microsoft.com/en-us/library/9yaffedz.aspxSA.On the page listed I can't find anywhere that would give the indication that it can handle...

View Article



int.Parse oddity

Integers don't have a fractional part. It's entirely understandable (and correct, IMHO) that the int.Parse method does not allow a decimal point in the textual representation of an integer. However, it...

View Article

int.Parse oddity

See my previous post... I am using that particular workaround... But parsing is something very specific: you have a string representation of something (a number in my case), in a somewhat known format...

View Article

int.Parse oddity

You could report this issue at Product Feedback.  I doubt you'll get anywhere with it though.  You're doing something very unusual; you're saying you want to parse a string in the Currency format but...

View Article

int.Parse oddity

The .NET 2.0 Class Lib referencehttp://msdn2.microsoft.com/en-us/library/9yaffedz.aspxSA.

View Article


int.Parse oddity

Which documentation ?

View Article

int.Parse oddity

cgraus:Yes, but that wasn't the issue. The issue was that the documentation seems to indicate that the int32.Parse method can handle "$77,500.50", and it can't. It throws an overflow exception, which...

View Article

int.Parse oddity

Math.Floor is what you're after then. 

View Article


int.Parse oddity

David:Yes, that's exactly the behavior I expected!I want "$2.99" to become 2, and not 3 or not 2.99. I am looking for truncation in this case, which is why first casting to a decimal amount doesn't...

View Article


int.Parse oddity

Are you sure you want to place a dollar amount into a int? That's what the decimal type is for. Someone could enter an amount of $2.99 which after the cast would be $2.00.It should be something you...

View Article

int.Parse oddity

A cast is, by definition, changing the type of the object.  tryparse is checking to see if a string contains the specific object in question.  It seemed odd to me that this would work when I first read...

View Article

int.Parse oddity

David:Thanks for your reply.I am not sure I think that's logical. My workaround is to parse the string as a decimal value and then cast it, as in:int ivalue = (int)dvalue;I would expect the parser to...

View Article

int.Parse oddity

Well the resulting number contains more percision than the Int32 can hold, so I don't think this is a bug with the behavior, but rather a bug with the documentation.

View Article


int.Parse oddity

Does the currency style allow for the comma ? 

View Article

int.Parse oddity

Hi all:I am trying to parse numeric input a user provides on a web site.I am having a problem with dollar amounts. The following command results in an OverflowException:int.Parse("77,500.50",...

View Article

Browsing all 15 articles
Browse latest View live




Latest Images