Converting integers into strings...
Greetings,
I'm kinda new to JS and I've been trying to find the solution to the problem below for several hours now. My question is how can i convert the variable integer into a string?
Thanks in advance
Boris http://echodev.com/
http://EchoWebHQ.com
WIN cash, free web hosting and up to 50,000 button exposures at http://echodev.com/contest/ in less than 60 seconds. EVERYONE IS A WINNER (seriously)!
Lloyd Hassell posted this at 03:57 — 17th April 2000.
They have: 231 posts
Joined: Feb 2000
The easiest way to do this is to add a blank string to a number.
var numCount = 54; // NUMBER
numCount += ""; // STRING
OR
numCount = numCount + "";
:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::
echoweb posted this at 04:02 — 17th April 2000.
They have: 52 posts
Joined: Nov 1999
It worked!
Thanks a lot...
Boris
------------------
-------------------------
Echo Web: The Web Developer's Starting Point
http://echoweb.newn.com
Anonymous posted this at 15:20 — 5th May 2000.
They have: 5,633 posts
Joined: Jan 1970
there is also a toString() function....
here's an example
var iNum=10;
var sNum=iNum.toString();
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.