tag:blogger.com,1999:blog-3740198534103035251.post8185680627990685179..comments2020-10-23T03:27:39.497-07:00Comments on Genlinux.rb - > genlinux.js: Javascript integer alertsUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-3740198534103035251.post-58889037952437087702011-11-21T11:23:12.048-08:002011-11-21T11:23:12.048-08:00001234567 is in javascript not treated as a base-1...001234567 is in javascript not treated as a base-10 number (Since it isn't! Numbers can't have prefix-0's). Instead it treats it as a number in octal form (http://www.diveintojavascript.com/core-javascript-reference/the-number-object)<br /><br />Thus 01234 in base 8 is actually 668 in base 10 (Decimal form).<br /><br />If you need to represent a "number" with prefix-zeroes, it is by definition not a number, but a string. So you won't even be needing to convert it, simply pass it as the string it already is.Anonymousnoreply@blogger.com