Since JS doesn't handle 19 significant digits in Number(), you'd have to
load the Id as a String():

   var data = '{"Id":"2688517729247252699",...

If you are just using the Id as an identifier, you probably don't need
to perform arithmetic on it.

If you do need to perform addition and subtraction on 19-digit numbers,
I suggest that you create a new Class for your long integers, which
would have two properties: the bottom half and the top half, both stored
as Number()s. You'll need a parseLongInteger() function to convert your
string to a LongInteger(); a LongInteger.toString() function to convert
back to String(); and .add() and .subtract() methods that add/subtract
the parts then perform any "carry" operations from one part to the
other.

If you need to multiply 19-digit numbers, you'd need to split them into
more than 2 parts.

I can't seem to find any good libraries for really long Javascript
integer arithmetic. Such libraries abound in other languages, using
String()s to hold the numbers, and performing character-by-character
arithmetic. There's a page with JS addition of long numbers here:

http://www.trans4mind.com/personal_development/JavaScript/longnumAdd.htm

-- 
Mike Williams
http://econym.org.uk/gmap



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to