Skip to main content

Bug Tracker

Side navigation

#11445 closed bug (duplicate)

Opened March 06, 2012 01:25PM UTC

Closed March 06, 2012 01:47PM UTC

Last modified March 06, 2012 01:48PM UTC

Parsing error on data

Reported by: shholmes@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

I have an html like this:

<input type="radio"
 class="class" 
 name="attr" 
 value="value" 
 data-identifier="13309600171026321254"/>

When I try to retrieve the identifier data attribute it recognizes it as a number and parse it, but it rounds the last part:

$("input.class").data("sku") 
// -> 13309600171106320000

If I try to parse the string as an int I have the same result:

parseInt("13309600171026321254")
// -> 13309600171106320000

I assume it's a bug on parseInt function but this kind of errors could be detected and then return the original string instead of trying to parse it.

Attachments (0)
Change History (3)

Changed March 06, 2012 01:32PM UTC by shholmes@gmail.com comment:1

I didn't notice I must put the code in jsFiddle sorry (and I have a typo on the example :( ).

Code testing this bug is in http://jsfiddle.net/cLyTE/1/

Changed March 06, 2012 01:47PM UTC by dmethvin comment:2

resolution: → duplicate
status: newclosed

Changed March 06, 2012 01:48PM UTC by dmethvin comment:3

Duplicate of #7579.