Firefox and parsing to int

A colleague of mine was working on a project an a strange issue occurred.

The string was “08” but when when you converted this via and int parse, Firefox read it as 0. All other browsers correctly parsed it to 8 but not Firefox.

In the end we just checked for a leading zero and removed before parsing.

Bizarre… I know.

Hope this help you if you ever run into a similar issue.

Advertisements
Tagged with: , ,
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: