Flow meter Directory

The Comprehensive Flowmeters Resource

Bits and Bytes

{source}
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>
<meta content=”text/html; charset=iso-8859-1″ http-equiv=”Content-Type”>
<meta content=”bits bytes kilobits kilobytes for webstats download.” name=”description”>
<meta content=”WHO IS BID” name=”keywords”>
<title> Kilobit Kilobytes confusion </title>
<style type=”text/css”>
A {
    text-decoration: none;
    color: black;
}
A:hover {
    text-decoration: underline;
    color: #FF9933;
}
.size12pt {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}
</style>
<style type=”text/css”>
<!–
.style8 {
    color: #FFFFFF;
}
body {
    background-color: #A3A3A3;
}
>
</style>
<script type=”text/javascript”>
<!–
var numDigs;
var curQuantity;
var initializing = true;

function loadOptions(){
    numDigs = getNumDigs();
    
    if (getDefaultQuantityMethod() == “userDefined”)
     curQuantity = getUserQuantity();
    else curQuantity = getCookie(“curQuantity”);
    if (curQuantity == null) curQuantity = “Length”;

    displayPage(curQuantity.toLowerCase() + “.htm”);
    initializing = false;
}

function getNumDigs(){
    var numDigs = getCookie(“UCNumDigs”);
    if (numDigs != null) return parseInt(numDigs);
    else return 6;
}

function getCookie(name){
    var cname = name + “=”;
    var dc = document.cookie;
    if (dc.length > 0) {
    begin = dc.indexOf(cname);
    if (begin != -1) {
     begin += cname.length;
     end = dc.indexOf(“;”, begin);
     if (end == -1) end = dc.length;
     return unescape(dc.substring(begin, end));
    }
    }
    return null;
}
function getDefaultQuantityMethod() {
    if (getCookie(“defaultQuantityMethod”) == “userDefined”)
    return “userDefined”;
    else return “remember”;
}
function getUserQuantity(){
    var i;
    var returnQuantity;
    var cookieQuantity = getCookie(“userQuantity”);
    
    // Default value
    returnQuantity = “Length”;

    // Check if valid cookie quantity exists
    if (cookieQuantity != null) {
    for (i = 0; i <= (quantities.length – 1); i++) {
     if (cookieQuantity == quantities[i]) returnQuantity = cookieQuantity;
    }
    }
    return returnQuantity;
}
function displayPage(URL)
{
    window.location.href = URL;
}

function Convert(){
    with(document.ConvertForm){
    ValueTo.value = formatFloat(parseFloat(ValueFrom.value) *
     parseFloat(UnitFrom.options[UnitFrom.selectedIndex].value) /
     parseFloat(UnitTo.options[UnitTo.selectedIndex].value), numDigs);
    }
}

function ConvertBack(){
    with(document.ConvertForm){
    ValueFrom.value = formatFloat(parseFloat(ValueTo.value) /
     parseFloat(UnitFrom.options[UnitFrom.selectedIndex].value) *
     parseFloat(UnitTo.options[UnitTo.selectedIndex].value), numDigs);
    }
}

function formatFloat(number,X) {
// rounds number to X decimal places, default is 6
    X = (!X ? 6 : X);
    return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}

>
</script>

</head>

<body leftmargin=”10″ marginheight=”0″ marginwidth=”10″ topmargin=”0″>
<form name=”ConvertForm”>
    <table border=”0″ cellspacing=”0″ cellpadding=”5″ align=”left”>
    <tr>
     <td><font face=”Arial, Helvetica, sans-serif” size=”+1″><b style=”color: #000″>Bits and bytes</b></font></td>
    </tr>
    <tr>
     <td valign=”top”>
         <table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″ align=”center”>
            <tr>
             <td bgcolor=”#000000″>
                <table width=”100%” border=”0″ cellspacing=”1″ cellpadding=”5″>
                 <tr>
                    
                 <td bgcolor=”#666666″><font face=”Arial, Helvetica, sans-serif” size=”-1″><b><font color=”#FFFFFF”>Input</font></b></font></td>
                 </tr>
                 <tr>
                    
                 <td bgcolor=”#FF0000″>
                    <table>
                        <tr>
                         <td>
                            <input type=”text” size=”20″ name=”ValueFrom” value=”1″ onKeyUp=”Convert()”> </td>
                         <td>
                            <select name=”UnitFrom” size=”1″ onChange=”Convert()”>
                             <option value=”0.125″>bits [b]</option>
                             <option selected value=”1″>bytes [B]</option>
                             <option value=”128″>kilobits [Kb]</option>
                             <option value=”1024″>kilobytes [KB]</option>
                             <option value=”131072″>megabits [Mb]</option>
                             <option value=”1048576″>megabytes [MB]</option>
                             <option value=”134217728″>gigabits [Gb]</option>
                             <option value=”1073741824″>gigabytes [GB]</option>
                             <option value=”137438953472″>terabits [Tb]</option>
                             <option value=”1099511627776″>terabytes [TB]</option>
                             <option value=”140737488355328″>petabits [Pb]</option>
                             <option value=”1125899906842624″>petabytes [PB]</option>
                             <option value=”144115188075855872″>exabits [Eb]</option>
                             <option value=”1152921504606846976″>exabytes [EB]</option>
                            </select> </td>
                         <td>
                            <input type=”button” name=”ButtonGO” value=”Go!” onClick=”Convert()” onFocus=”if(this.blur)this.blur()”> </td>
                        </tr>
                    </table> </td>
                 </tr>
                </table> </td>
            </tr>
         </table>
         <table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
            <tr>
            
            <td>&nbsp;</td>
            </tr>
         </table>
         <table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″ align=”center”>
            <tr>
             <td bgcolor=”#000000″>
                <table width=”100%” border=”0″ cellspacing=”1″ cellpadding=”5″>
                 <tr>
                    
                 <td bgcolor=”#666666″><font face=”Arial, Helvetica, sans-serif” size=”-1″><b><font color=”#FFFFFF”>Output</font></b></font></td>
                 </tr>
                 <tr>
                    
                 <td bgcolor=”#CCCCCC”>
                    <table>
                        <tr valign=”middle”>
                         <td>
                            <input type=”text” size=”20″ name=”ValueTo” onKeyUp=”ConvertBack()”> </td>
                         <td>
                            <select name=”UnitTo” size=”1″ onChange=”Convert()”>
                             <option value=”0.125″>bits [b]</option>
                             <option selected value=”1″>bytes [B]</option>
                             <option value=”128″>kilobits [Kb]</option>
                             <option value=”1024″>kilobytes [KB]</option>
                             <option value=”131072″>megabits [Mb]</option>
                             <option value=”1048576″>megabytes [MB]</option>
                             <option value=”134217728″>gigabits [Gb]</option>
                             <option value=”1073741824″>gigabytes [GB]</option>
                             <option value=”137438953472″>terabits [Tb]</option>
                             <option value=”1099511627776″>terabytes [TB]</option>
                             <option value=”140737488355328″>petabits [Pb]</option>
                             <option value=”1125899906842624″>petabytes [PB]</option>
                             <option value=”144115188075855872″>exabits [Eb]</option>
                             <option value=”1152921504606846976″>exabytes [EB]</option>
                            </select> </td>
                        </tr>
                    </table> </td>
                 </tr>
                </table> </td>
            </tr>
         </table> </td>
    </tr>
    <tr>
     <td valign=”top”></td>
    </tr>
    </table>
</form>
</body>

</html>

{/source}

Scroll to Top