ephi (ivles) wrote in s2practice,

converting int to string

I have this code below:

var int cdepth = 445+(15*($c.depth-1));

I want to convert $cdepth into a string because I need it as a string variable. How is that possible?

There's no info about it in the Core and I used LJSeek to search this community with no result either. Thanks.

Edit: Actually, the actual codes in Core had this and I suggest anyone to look at the Core Code instead of the Core Documentation.
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

string(int i) : string // Return the given integer as a string

So you can either create a separate variable that's a string, or do

var string cdepth = string(445+(15*($c.depth-1)));
thank you. I'll try.