if (selectunit == "Bytes") value_Of_Bytes = the_Value
else if (selectunit == "Kb") value_Of_Bytes = the_Value * 1024
else if (selectunit == "Mb") value_Of_Bytes = the_Value * 1024 * 1024
else if (selectunit == "Gb") value_Of_Bytes = the_Value * 1024 * 1024 * 1024
alert(the_Value + " " + selectunit + " is equal to:\n\n- " + value_Of_Bytes + " Bytes\n- " + Math.round(value_Of_Bytes / 1024) + " Kb\n- " + Math.round(value_Of_Bytes / 1024 / 1024) + " Mb\n- " + Math.round(value_Of_Bytes / 1024 / 1024 / 1024) + " Gb\n"
<script> var value_Of_Bytes = 0 function value_to_units_Results() { var the_Value = document.value_units_Form.numeric_value.value var selectunit = document.value_units_Form.units.options[document.value_units_Form.units.selectedIndex].value if (selectunit == "Bytes") value_Of_Bytes = the_Value else if (selectunit == "Kb") value_Of_Bytes = the_Value * 1024 else if (selectunit == "Mb") value_Of_Bytes = the_Value * 1024 * 1024 else if (selectunit == "Gb") value_Of_Bytes = the_Value * 1024 * 1024 * 1024 alert(the_Value + " " + selectunit + " is equal to:\n\n- " + value_Of_Bytes + " Bytes\n- " + Math.round(value_Of_Bytes / 1024) + " Kb\n- " + Math.round(value_Of_Bytes / 1024 / 1024) + " Mb\n- " + Math.round(value_Of_Bytes / 1024 / 1024 / 1024) + " Gb\n") } </script>