Book a Demo

Author Topic: JScript convert string to int  (Read 5702 times)

Nathan

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
JScript convert string to int
« on: January 04, 2012, 08:45:52 am »
I'm trying to convert a string to int using Jscript in the scripting window.  The standard conversion methods suggested by Microsoft in the JScript reference do not seem to be working.  Does EA implement some non-standard version of Jscript?  And if so, how do you type convert in it?  Thanks.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: JScript convert string to int
« Reply #1 on: January 04, 2012, 09:12:16 am »
Nothing special that I am aware of.  What have you tried?  Have you tried using parseInt()?  Worked fine for me.

Code: [Select]
var i;
i = parseInt("123");