#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    111
    Rep Power
    14

    Javascript - Number to binary


    Is there a function that converts a whole number (integer) to a binary number??

    wabirdman
    Real programmers code in binary
  2. #2
  3. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    Number.toString(2)

    var x = 255;
    alert(x.toString(2));

    http://caucuscare.com/~roth/JAVASCRIPT/refp_272.htm
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Australia
    Posts
    111
    Rep Power
    14
    Thanks very much

    wabirdman
    Real programmers code in binary

IMN logo majestic logo threadwatch logo seochat tools logo