Discussion Locked

javascript

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How do you convert a number/ integer
into a string, e.g.

"10" to "ten".

Any help is appreciated.

3 replies

by michael2

tmp_string = number.toString();

if number above was 10, the integer tmp_string will be "10" the string. There is no javascript function for returning "ten" from the integer 10.

You would have to use switch()and write something along the lines of

switch(x){

case 1:
x = "one"
break;

case 2:
x = "two"
break;

etc,ect,,
}

by ogunbooa

THanx Michael,
It works... do you have any online resources for advanced javascripting...?

Seyi

This discussion is closed to new replies.