By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,629 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,629 IT Pros & Developers. It's quick & easy.

how to convert integer to string in javascript

P: n/a
i have number that i need to concatenate with string
Jul 23 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
TomislaW wrote on 24 mrt 2005 in comp.lang.javascript:
i have number that i need to concatenate with string


result = 7 + " dwarfs of Snowwhite."

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #2

P: n/a
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
TomislaW wrote on 24 mrt 2005 in comp.lang.javascript:
i have number that i need to concatenate with string


result = 7 + " dwarfs of Snowwhite."


this does not work with firefox(mozilla)
Jul 23 '05 #3

P: n/a
TomislaW wrote on 24 mrt 2005 in comp.lang.javascript:
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
TomislaW wrote on 24 mrt 2005 in comp.lang.javascript:
i have number that i need to concatenate with string


result = 7 + " dwarfs of Snowwhite."


this does not work with firefox(mozilla)


I don't believe it. It is basic javascript.

Could you try to debug with 6 dwarfs perhaps?
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 23 '05 #4

P: n/a
TomislaW wrote:
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
TomislaW wrote on 24 mrt 2005 in comp.lang.javascript:
i have number that i need to concatenate with string


result = 7 + " dwarfs of Snowwhite."

this does not work with firefox(mozilla)


MyNum.toString(10)+MyString

(10 is decimal, 16 would be hexadecimal)
Jul 23 '05 #5

P: n/a
Lee
TomislaW said:

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
TomislaW wrote on 24 mrt 2005 in comp.lang.javascript:
i have number that i need to concatenate with string


result = 7 + " dwarfs of Snowwhite."


this does not work with firefox(mozilla)


Sure it does. Show us exactly what "does not work".

Jul 23 '05 #6

P: n/a
TomislaW wrote:
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
TomislaW wrote on 24 mrt 2005 in comp.lang.javascript:
i have number that i need to concatenate with string


result = 7 + " dwarfs of Snowwhite."

this does not work with firefox(mozilla)


It should. Please show exactly what you are doing that doesn't work.
---
John W. Kennedy
"I want everybody to be smart. As smart as they can be. A world of
ignorant people is too dangerous to live in."
-- Garson Kanin. "Born Yesterday"
Jul 23 '05 #7

P: n/a
Lee wrote:
TomislaW said:
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
TomislaW wrote on 24 mrt 2005 in comp.lang.javascript:

i have number that i need to concatenate with string

result = 7 + " dwarfs of Snowwhite."


this does not work with firefox(mozilla)

Sure it does. Show us exactly what "does not work".


num="Zero,One,Two,Three,Four,Five,Six,Seven".split (",")

function fplural(word){return word.substring(0,word.length-1)+"ves"}
result=num[7]+" "+ fplural("dwarf")+" of Snow White";
document.write(result);

Mick
Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.