0

Please can someone help?

I'm parsing Facebook event data into my website and find that the event IDs are often huge numbers which creates problems in the script.

Investigating I found that the long numbers were being converted to scientific notation automatically when set into a variable.

My problem comes when I convert it back to a number, the value is slightly changed.

USING: IIS6, Classic ASP, VB Script

Example...

<%
Test = 1415720948649554
response.write Test & "<br/>"
response.write FormatNumber(Test,0,-2,-2, false)
%>

This results in...

1.41572094864955E+15

1415720948649550

Of course neither number being correct!!

Please, please help. I've spent hours trying to work this out.

Thanks

Matt

Community
  • 1
  • 1
Matt Deemer
  • 133
  • 1
  • 3
  • 9

2 Answers2

2

If the event IDs are purely querystring values which you need to pass to and from Facebook, and you don't need to do any maths with them, then you could always use cstr to convert them from integers to strings - eg

<%
Test = cstr("1415720948649554")
response.write Test & "<br/>"
%>
John
  • 4,658
  • 2
  • 14
  • 23
1

That number is too big to be managed as an Integer or Long, then it is automatically translated (with poor results) in a Double: http://msdn.microsoft.com/en-us/library/9e7a57cf(v=vs.84).aspx

Have you tryed to use that value as text string?

temp = "1415720948649554"
ReDEyeS
  • 851
  • 5
  • 16