Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q269 How do you convert an integer to a string?

You are here: irt.org | FAQ | JavaScript | Number | Q269 [ previous next ]

<script language="JavaScript"><!--
var myinteger = 123;
var mystring = myinterger + '';
//--></script>

To do the reverse, simply subtract zero from the string:

<script language="JavaScript"><!--
var mystring = '123';
var myinteger = mystring - 0;
//--></script>

Feedback on 'Q269 How do you convert an integer to a string?'

©2018 Martin Webb