Hrm...toString should be working:
var number = 12;
alert(typeof mynumber + ' is not a ' + typeof mynumber.toString());
Should alert "number is not a string". So it is being converted. What version of browser are they using? Have you tried to pass the integer to the function, then on the first line of the function, convert it to a string?
x += '' Adding a string to an integer in Javascript converts the entire variable to a string variable. Many other languages will give you a type mismatch error.
Main Topics
Browse All Topics





by: ZvonkoPosted on 2006-06-17 at 05:43:35ID: 16926565
First Google shot was this: m/js/colum n26/tostri ng.html
http://www.webreference.co
So I would confirm the readability aspects of toString() but at the end I would use +''