Results 1 to 1 of 1

Thread: Bandwidth Calculator

  1. #1
    Senior Member ghaza's Avatar
    Join Date
    Oct 2013
    Location
    Multan, Pakistan
    Posts
    354

    Bandwidth Calculator

    Confused about the various units used to calculate bandwidth, and their equivalent in another unit? Use this bandwidth calculator to instantly figure it out! Just enter a number, select the unit of input, and this script shows its equivalent in the four standard units of bandwidth (Bytes, Kilobytes, Megabytes, and Gigabytes). Very handy script.

    Simply insert the below into the <body> section of your page:

    HTML Code:
    <form name="bandwidth">
    
      <p><input type="text" name="original" size="20" value=1024> <select size="1" name="units">
        <option value="Bytes">Bytes</option>
        <option value="Kb">Kb</option>
        <option value="Mb">Mb</option>
        <option value="Gb">Gb</option>
      </select> <input type="button" value="Calculate" name="B1" onClick="calculate()"></p>
    </form>
    
    <p>
    
    <script>
    
    /*
    Bandwidth calculator (credit must stay enclosed)
    By javascriptkit.com
    For this and over 400+ JavaScripts,
    Visit http://www.adminspoint.com
    */
    
    var bytevalue=0
    function calculate(){
    var invalue=document.bandwidth.original.value
    var selectunit=document.bandwidth.units.options[document.bandwidth.units.selectedIndex].value
    if (selectunit=="Bytes")
    bytevalue=invalue
    else if (selectunit=="Kb")
    bytevalue=invalue*1024
    else if (selectunit=="Mb")
    bytevalue=invalue*1024*1024
    else if (selectunit=="Gb")
    bytevalue=invalue*1024*1024*1024
    
    alert (invalue+" "+selectunit+" is equal to:\n\n- "+bytevalue+" Bytes\n- "+Math.round(bytevalue/1024)+" Kb\n- "+Math.round(bytevalue/1024/1024)+" Mb\n- "+Math.round(bytevalue/1024/1024/1024)+" Gb\n")
    }
    
    </script>
    
    <p align="center">This free script provided by<br />
    <a href="http://www.adminspoint.com">adminspoint</a></p>
    Demo is available in the attachment..
    Attached Files Attached Files
    Last edited by ghaza; 11-12-2013 at 05:48 AM.

Similar Threads

  1. Replies: 0
    Last Post: 09-01-2011, 12:24 AM
  2. Modify Bandwidth Exceeded Page in WHM cPanel
    By AP admin in forum Web Hosting Control Panels
    Replies: 0
    Last Post: 07-28-2010, 07:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •