How to get correct integer value if we give more that 16 digit number?

javascript, jquery

Solution

JavaScript uses 64bit floating point numbers exclusively, which means you only get about 16 decimal digits of precision. This is a fundamental limitation of the number type.

You can store the digits as a string instead. If you need to do computations with numbers this big you'll have to use a library that implements arbitrary precision arithmetic.

Problem

In my code I am getting an input value (integer variable) more that 16 digit number not able to get correct value. HTML: ``` <div><input id="number_id" value="111111111111111111"></div> ``` Script: ``` $("#number_id").blur(function(){ var ns = $("#number_id").val(); alert(Number(ns)) }); ``` any one have solution please help me. http://jsfiddle.net/Qntr2/

Original source