»
EnglishFrenchVietnamese

Print - The Byte Converter - JavaScriptBank.com

Full version: jsB@nk » Calculation » Equivalent » The Byte Converter
URL: https://www.javascriptbank.com/byteconverter.html

The Byte Converter © JavaScriptBank.comThis is a byte converter.

Full version: jsB@nk » Calculation » Equivalent » The Byte Converter
URL: https://www.javascriptbank.com/byteconverter.html



JavaScript
<script language="JavaScript"><!--  function convert(f) {    f.kb.value=Math.round(f.byte.value/1024*100000)/100000    f.mb.value=Math.round(f.byte.value/1048576*100000)/100000    f.gb.value=Math.round(f.byte.value/1073741824*100000)/100000       }function convertkb(f) {    f.byte.value=Math.round(f.kb.value*1024*100000)/100000    f.mb.value=Math.round(f.kb.value/1024*100000)/100000    f.gb.value=Math.round(f.kb.value/1048576*100000)/100000       }function convertmb(f) {    f.byte.value=Math.round(f.mb.value*1048576*100000)/100000    f.kb.value=Math.round(f.mb.value*1024*100000)/100000    f.gb.value=Math.round(f.mb.value/1024*100000)/100000       }function convertgb(f) {    f.byte.value=Math.round(f.gb.value*1073741824*100000)/100000    f.kb.value=Math.round(f.gb.value*1048576*100000)/100000    f.mb.value=Math.round(f.gb.value*1024*100000)/100000       }  // --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
  <form>      <table border="3" bgcolor="#ffffa8" cellpadding="3" cellspacing="3" align=center>    <tbody><tr>       <td align="center"><font size="5" face="Arial, Helvetica, sans-serif"><strong>Byte</strong></font></td>      <td align="center"><b><font size="5" face="Arial, Helvetica, sans-serif"><strong>Kilobyte</strong></font></b></td>      <td align="center"><b><font size="5" face="Arial, Helvetica, sans-serif">Megabyte</font></b></td>      <td align="center"><font size="5" face="Arial, Helvetica, sans-serif"><b>Gigabyte</b></font></td>    </tr>    <tr>       <td align="center">         <input type="text" size="10" name="byte" value="0">      </td>      <td align="center">         <input type="text" size="10" name="kb" value="0">      </td>      <td align="center">         <input type="text" size="10" name="mb" value="0">      </td>      <td align="center">         <input type="text" size="10" name="gb" value="0">      </td>    </tr>    <tr>       <td align="center">         <input type="button" name="B2" value="   &gt;   " onclick="convert(this.form)">      </td>      <td align="center">        <input type="button" name="B22" value="   &lt; &gt;   " onclick="convertkb(this.form)">      </td>      <td align="center">        <input type="button" name="B23" value="   &lt; &gt;   " onclick="convertmb(this.form)">      </td>      <td align="center">        <input type="button" name="B24" value="   &lt;   " onclick="convertgb(this.form)">      </td>    </tr>  </tbody></table>  </form><p><font face="Arial, Helvetica, sans-serif" size="2">1 Byte = 8 Bit<br>  1 Kilobyte = 1024 Bytes<br>  1 Megabyte = 1048576 Bytes<br>  1 Gigabyte = 1073741824 Bytes</font></p><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->