Why is my value rounded (up or down)

In my entity framework model (from oracle) I have a table that contains the following Column
enter image description here

Now. I use an asp.net webforms datagrid to view the data. At one stage the value in this column is 635838861561284513. I do (in theory) send this value through as a parameter on the url when I click a custom link on this grid. The value is added to the url as follows:

  • Hosting ASP.Net with HTML5 JS and Twitter Bootstrap formats differently
  • SignalR client doesn't work inside AngularJs controller
  • Close Window for button click
  • how to get selected value from dropdownlist in asp.net using javascript?
  • Asp.net Set Textbox 1 to Equal Textbox 2
  • ASP.NET MVC & Angular: After session expires, Angular Factory returns HTML of Login Page instead of JSON object
  • <a href="javascript:Cover(<%# Eval("BATCH_NO") %>);">View</a>

    Now I noticed upon debugging that the value "<%# Eval("BATCH_NO") %>" comes through as 635838861561284500 and not 635838861561284513.

    But the value displays correctly in the grid!!

    Can anyone explain why this is happening?

  • Javascript event subscription after UpdatePanel async postback
  • ASP.net Button on click not firing using Jquery Modal Dialog
  • jquery prompt to save data onbeforeunload
  • What does JavaScript Routing buy you?
  • Display the current date in an ASP.NET label with C# and JS
  • How do you get the style of an element on an asp.net page
  • One Solution collect form web for “Why is my value rounded (up or down)”

    Because JavaScript’s numbers are IEEE-754 double-precision floating point numbers, which have 53 bits to store the unscaled value of the number (the other bits are for exponent), which translates to just under 16 decimal digits of precision. Their maximum “safe” integer value (integer value that won’t lose precision) is 9007199254740991. Your
    635838861561284513 is much bigger than that.

    If you want to pass that number to and from JavaScript, best to keep it in a string.