Skip to main content

Bug Tracker

Side navigation

#11178 closed bug (duplicate)

Opened January 15, 2012 10:37PM UTC

Closed January 16, 2012 12:16AM UTC

Last modified January 16, 2012 12:17AM UTC

data- attribute with 18 digit or larger number

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Every digit after the 17th comes back as a zero instead of its proper value.

I am not familiar with all the uses of isNumeric so I suggest only checking values for dataAttr function

line 1996:

jQuery.isNumeric( data ) && data.length < ( data.indexOf('.') != -1 ? 18 : 17 ) ? parseFloat( data ) :

Otherwise, we could just not try to convert to a number.

Attachments (0)
Change History (2)

Changed January 16, 2012 12:16AM UTC by rwaldron comment:1

resolution: → duplicate
status: newclosed converts all string values into real JavaScript primitive and object values (string, number, boolean, object, array etc). Given this information and knowing that the largest finite integral number in JavaScript is 2^53, or 9007199254740992 (try adding 1 to that number, it won't work), which is 16 characters long, we can assume that numbers of that length will not be valid in JavaScript. If you need the full value, access with jQuery.fn.attr()

Changed January 16, 2012 12:17AM UTC by rwaldron comment:2

Duplicate of #10174.