'용량'에 해당되는 글 1건

  1. 2008.01.30 파일 용량 계산 (Gb / Mb / Kb / Bytes)
<HTML>
<HEAD>

<script>
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>

</HEAD>
<BODY>

<form name="bandwidth">
  <p align=center><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()" style="border:solid 1; font-family:Tahoma,Verdana,굴림; font-size:8pt; color:white; background-color:black; height:21px"></p>
</form>

</body>
</HTML>
Posted by 알 수 없는 사용자
,