There is now, it's called parseBin. Just keep this bit of script in your pages and you'll be OK.
I named the function parseBin because it's easy to remember and is like the built in parseInt.
It even returns the value that you pass it so you can do things like:
var number=parseBin(1024);
I've tried to demonstrate that in the links on the page.
Edit: You should know that the binary number that is returned is just a base-10 number that only happens to contain 1's and 0's. If you want to do any sums with binary numbers in then you would have to do the sum first and then convert the answer to binary.
If you intend to convert large numbers to binary then it would be best if the binary number was returned as a string because otherwise the binary number would be huge and would look something like this:
I didn't know you could do that with toString but in any case I guess it's sorted now, in defence of my script though...
Originally posted by lavalamp If you intend to convert large numbers to binary then it would be best if the binary number was returned as a string because otherwise the binary number would be huge
In this case, you entered an absolutely huge number to start with.
Comment