menambahkan titik koma di javascript
-
halo..selamat pagi,
langsung saja ya, saya butuh bantuannya para suhu dan masta sekaliansaya memiliki html sebagai berikut:
<script type="text/javascript"> function tambah(){ var nilai1=document.getElementById("val1").value; var nilai2=document.getElementById("val2").value; var nilai3=document.getElementById("val3").value; var nilai4=document.getElementById("val4").value; var nilai5=document.getElementById("val5").value; var nilai6=document.getElementById("val6").value; var nilai7=document.getElementById("val7").value; var nilai8=document.getElementById("val8").value; var nilai9=document.getElementById("val9").value; var nilai10=document.getElementById("val10").value; var nilai11=document.getElementById("val11").value; var nilai12=document.getElementById("val12").value; var nilai13=document.getElementById("val13").value; var nilai14=document.getElementById("val14").value; var nilai15=document.getElementById("val15").value; var nilai16=document.getElementById("val16").value; var nilai17=document.getElementById("val17").value; var nilai18=document.getElementById("val18").value; var nilai19=document.getElementById("val19").value; var nilai20=document.getElementById("val20").value; var nilai21=document.getElementById("val21").value; var nilai22=document.getElementById("val22").value; var nilai23=document.getElementById("val23").value; var nilai24=document.getElementById("val24").value; var nilai25=document.getElementById("val25").value; var nilai26=document.getElementById("val26").value; var nilai27=document.getElementById("val27").value; var nilai28=document.getElementById("val28").value; var nilai29=document.getElementById("val29").value; var nilai30=document.getElementById("val30").value; var nilai31=document.getElementById("val31").value; var nilai32=document.getElementById("val32").value; var nilai33=document.getElementById("val33").value; var nilai34=document.getElementById("val34").value; var nilai35=document.getElementById("val35").value; var nilai36=document.getElementById("val36").value; var nilai37=document.getElementById("val37").value; var nilai38=document.getElementById("val38").value; var nilai39=document.getElementById("val39").value; var nilai40=document.getElementById("val40").value; var nilai41=document.getElementById("val41").value; var nilai42=document.getElementById("val42").value; var nilai43=document.getElementById("val43").value; var nilai44=document.getElementById("val44").value; var nilai45=document.getElementById("val45").value; //operasi kali var hasil1a=parseInt(nilai1)*parseFloat(nilai2)*parseFloat(nilai3); var hasil2a=parseInt(nilai4)*parseFloat(nilai5)*parseFloat(nilai6); var hasil3a=parseInt(nilai7)*parseFloat(nilai8)*parseFloat(nilai9); var hasil4a=parseInt(nilai10)*parseFloat(nilai11)*parseFloat(nilai12); var hasil5a=parseInt(nilai13)*parseFloat(nilai14)*parseFloat(nilai15); var hasil6a=parseInt(nilai16)*parseFloat(nilai17)*parseFloat(nilai18); var hasil7a=parseInt(nilai19)*parseFloat(nilai20)*parseFloat(nilai21); var hasil8a=parseInt(nilai22)*parseFloat(nilai23)*parseFloat(nilai24); var hasil9a=parseInt(nilai25)*parseFloat(nilai26)*parseFloat(nilai27); var hasil10a=parseInt(nilai28)*parseFloat(nilai29)*parseFloat(nilai30); var hasil11a=parseInt(nilai31)*parseFloat(nilai32)*parseFloat(nilai33); var hasil12a=parseInt(nilai34)*parseFloat(nilai35)*parseFloat(nilai36); var hasil13a=parseInt(nilai37)*parseFloat(nilai38)*parseFloat(nilai39); var hasil14a=parseInt(nilai40)*parseFloat(nilai41)*parseFloat(nilai42); var hasil15a=parseInt(nilai43)*parseFloat(nilai44)*parseFloat(nilai45); //operasi totalwh var totalwh=parseFloat(hasil1a)+parseFloat(hasil2a)+parseFloat(hasil3a)+parseFloat(hasil4a)+parseFloat(hasil5a)+parseFloat(hasil6a)+parseFloat(hasil7a)+parseFloat(hasil8a)+parseFloat(hasil9a)+parseFloat(hasil10a)+parseFloat(hasil11a)+parseFloat(hasil12a)+parseFloat(hasil13a)+parseFloat(hasil14a)+parseFloat(hasil15a); //operasi totalkwh var totalkwh=parseInt(totalwh)/1000; //operasi kwh var hasil1b=parseInt(hasil1a)/1000; var hasil2b=parseInt(hasil2a)/1000; var hasil3b=parseInt(hasil3a)/1000; var hasil4b=parseInt(hasil4a)/1000; var hasil5b=parseInt(hasil5a)/1000; var hasil6b=parseInt(hasil6a)/1000; var hasil7b=parseInt(hasil7a)/1000; var hasil8b=parseInt(hasil8a)/1000; var hasil9b=parseInt(hasil9a)/1000; var hasil10b=parseInt(hasil10a)/1000; var hasil11b=parseInt(hasil11a)/1000; var hasil12b=parseInt(hasil12a)/1000; var hasil13b=parseInt(hasil13a)/1000; var hasil14b=parseInt(hasil14a)/1000; var hasil15b=parseInt(hasil15a)/1000; //menampilkan hasil kali document.getElementById("hasil1a").value=parseFloat(hasil1a).toFixed(2); document.getElementById("hasil2a").value=parseFloat(hasil2a).toFixed(2); document.getElementById("hasil3a").value=parseFloat(hasil3a).toFixed(2); document.getElementById("hasil4a").value=parseFloat(hasil4a).toFixed(2); document.getElementById("hasil5a").value=parseFloat(hasil5a).toFixed(2); document.getElementById("hasil6a").value=parseFloat(hasil6a).toFixed(2); document.getElementById("hasil7a").value=parseFloat(hasil7a).toFixed(2); document.getElementById("hasil8a").value=parseFloat(hasil8a).toFixed(2); document.getElementById("hasil9a").value=parseFloat(hasil9a).toFixed(2); document.getElementById("hasil10a").value=parseFloat(hasil10a).toFixed(2); document.getElementById("hasil11a").value=parseFloat(hasil11a).toFixed(2); document.getElementById("hasil12a").value=parseFloat(hasil12a).toFixed(2); document.getElementById("hasil13a").value=parseFloat(hasil13a).toFixed(2); document.getElementById("hasil14a").value=parseFloat(hasil14a).toFixed(2); document.getElementById("hasil15a").value=parseFloat(hasil15a).toFixed(2); //menampilkan hasil kwh document.getElementById("hasil1b").value=parseFloat(hasil1b).toFixed(3); document.getElementById("hasil2b").value=parseFloat(hasil2b).toFixed(3); document.getElementById("hasil3b").value=parseFloat(hasil3b).toFixed(3); document.getElementById("hasil4b").value=parseFloat(hasil4b).toFixed(3); document.getElementById("hasil5b").value=parseFloat(hasil5b).toFixed(3); document.getElementById("hasil6b").value=parseFloat(hasil6b).toFixed(3); document.getElementById("hasil7b").value=parseFloat(hasil7b).toFixed(3); document.getElementById("hasil8b").value=parseFloat(hasil8b).toFixed(3); document.getElementById("hasil9b").value=parseFloat(hasil9b).toFixed(3); document.getElementById("hasil10b").value=parseFloat(hasil10b).toFixed(3); document.getElementById("hasil11b").value=parseFloat(hasil11b).toFixed(3); document.getElementById("hasil12b").value=parseFloat(hasil12b).toFixed(3); document.getElementById("hasil13b").value=parseFloat(hasil13b).toFixed(3); document.getElementById("hasil14b").value=parseFloat(hasil14b).toFixed(3); document.getElementById("hasil15b").value=parseFloat(hasil15b).toFixed(3); //menampilkan hasil totalwh document.getElementById("totalwh").value=parseFloat(totalwh).toFixed(2); //menampilkan hasil totalkwh document.getElementById("totalkwh").value=parseFloat(totalkwh).toFixed(3); } function refresh(){ //mengosongkan form document.getElementById("totalwh").value=""; document.getElementById("totalkwh").value=""; document.getElementById("val1").value="0"; document.getElementById("val2").value="0"; document.getElementById("val3").value="0"; document.getElementById("val4").value="0"; document.getElementById("val5").value="0"; document.getElementById("val6").value="0"; document.getElementById("val7").value="0"; document.getElementById("val8").value="0"; document.getElementById("val9").value="0"; document.getElementById("val10").value="0"; document.getElementById("val11").value="0"; document.getElementById("val12").value="0"; document.getElementById("val13").value="0"; document.getElementById("val14").value="0"; document.getElementById("val15").value="0"; document.getElementById("val16").value="0"; document.getElementById("val17").value="0"; document.getElementById("val18").value="0"; document.getElementById("val19").value="0"; document.getElementById("val20").value="0"; document.getElementById("val21").value="0"; document.getElementById("val22").value="0"; document.getElementById("val23").value="0"; document.getElementById("val24").value="0"; document.getElementById("val25").value="0"; document.getElementById("val26").value="0"; document.getElementById("val27").value="0"; document.getElementById("val28").value="0"; document.getElementById("val29").value="0"; document.getElementById("val30").value="0"; document.getElementById("val31").value="0"; document.getElementById("val32").value="0"; document.getElementById("val33").value="0"; document.getElementById("val34").value="0"; document.getElementById("val35").value="0"; document.getElementById("val36").value="0"; document.getElementById("val37").value="0"; document.getElementById("val38").value="0"; document.getElementById("val39").value="0"; document.getElementById("val40").value="0"; document.getElementById("val41").value="0"; document.getElementById("val42").value="0"; document.getElementById("val43").value="0"; document.getElementById("val44").value="0"; document.getElementById("val45").value="0"; document.getElementById("hasil1a").value=""; document.getElementById("hasil2a").value=""; document.getElementById("hasil3a").value=""; document.getElementById("hasil4a").value=""; document.getElementById("hasil5a").value=""; document.getElementById("hasil6a").value=""; document.getElementById("hasil7a").value=""; document.getElementById("hasil8a").value=""; document.getElementById("hasil9a").value=""; document.getElementById("hasil10a").value=""; document.getElementById("hasil11a").value=""; document.getElementById("hasil12a").value=""; document.getElementById("hasil13a").value=""; document.getElementById("hasil14a").value=""; document.getElementById("hasil15a").value=""; document.getElementById("hasil1b").value=""; document.getElementById("hasil2b").value=""; document.getElementById("hasil3b").value=""; document.getElementById("hasil4b").value=""; document.getElementById("hasil5b").value=""; document.getElementById("hasil6b").value=""; document.getElementById("hasil7b").value=""; document.getElementById("hasil8b").value=""; document.getElementById("hasil9b").value=""; document.getElementById("hasil10b").value=""; document.getElementById("hasil11b").value=""; document.getElementById("hasil12b").value=""; document.getElementById("hasil13b").value=""; document.getElementById("hasil14b").value=""; document.getElementById("hasil15b").value=""; document.getElementById("row1").value=""; document.getElementById("row2").value=""; document.getElementById("row3").value=""; document.getElementById("row4").value=""; document.getElementById("row5").value=""; document.getElementById("row6").value=""; document.getElementById("row7").value=""; document.getElementById("row8").value=""; document.getElementById("row9").value=""; document.getElementById("row10").value=""; document.getElementById("row11").value=""; document.getElementById("row12").value=""; document.getElementById("row13").value=""; document.getElementById("row14").value=""; document.getElementById("row15").value=""; } </script> <style type="text/css"> .Table { display: table;width: 100%; } .Title { display: table-caption; text-align: center; font-weight: bold; font-size: larger; } .Heading { display: table-row;background:#333; } .Row { display: table-row; } .Cell { display: table-cell; border: solid; border-width: thin; padding: 5px; } </style> <div class="Table"> <div class="Title"> <p>Alat ini dipergunakan sebagai salah satu dasar perhitungan untuk PLTS</p> <h6 style="font-size:14px;text-align:left;"><em>* Belum memperhitungkan kapasitas daya rumah</em></h6> </div> <div class="Heading"> <div class="Cell"> <p><span style="color: #ffffff;">Nama / Jenis Beban</span></p> </div> <div class="Cell"> <p><span style="color: #ffffff;">Qty (buah)</span></p> </div> <div class="Cell"> <p><span style="color: #ffffff;">Daya (watt)</span></p> </div> <div class="Cell"> <p><span style="color: #ffffff;">Durasi (jam)</span></p> </div> <div class="Cell"> <p><span style="color: #ffffff;">Wh</span></p> </div> <div class="Cell"> <p><span style="color: #ffffff;">KWh</span></p> </div> </div> <div class="Row"> <div class="Cell"> <p><name="nama" id="contoh" value="lampu" maxlength="10"><em>(contoh)Lampu</em></p> </div> <div class="Cell"> <p><name="n1" id="contoh" value="2" maxlength="5">2</p> </div> <div class="Cell"> <p><name="n2" id="contoh" value="20" maxlength="5">20</p> </div> <div class="Cell"> <p><name="n3" id="contoh" value="12" maxlength="5">12</p> </div> <div class="Cell"> <p><value="480">480.00</p> </div> <div class="Cell"> <p><value="0">0.480</p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row1" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n1" value="0" id="val1" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n2" value="0" id="val2" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n3" value="0" id="val3" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil1a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil1b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row2" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n4" value="0" id="val4" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n5" value="0" id="val5" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n6" value="0" id="val6" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil2a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil2b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row3" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n7" value="0" id="val7" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n8" value="0" id="val8" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n9" value="0" id="val9" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil3a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil3b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row4" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n10" value="0" id="val10" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n11" value="0" id="val11" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n12" value="0" id="val12" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil4a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil4b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row5" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n13" value="0" id="val13" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n14" value="0" id="val14" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n15" value="0" id="val15" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil5a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil5b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row6" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n16" value="0" id="val16" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n17" value="0" id="val17" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n18" value="0" id="val18" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil6a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil6b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row7" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n19" value="0" id="val19" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n20" value="0" id="val20" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n21" value="0" id="val21" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil7a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil7b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row8" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n22" value="0" id="val22" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n23" value="0" id="val23" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n24" value="0" id="val24" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil8a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil8b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row9" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n25" value="0" id="val25" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n26" value="0" id="val26" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n27" value="0" id="val27" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil9a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil9b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row10" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n28" value="0" id="val28" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n29" value="0" id="val29" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n30" value="0" id="val30" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil10a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil10b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row11" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n31" value="0" id="val31" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n32" value="0" id="val32" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n33" value="0" id="val33" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil11a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil11b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row12" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n34" value="0" id="val34" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n35" value="0" id="val35" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n36" value="0" id="val36" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil12a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil12b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row13" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n37" value="0" id="val37" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n38" value="0" id="val38" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n39" value="0" id="val39" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil13a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil13b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row14" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n40" value="0" id="val40" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n41" value="0" id="val41" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n42" value="0" id="val42" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil14a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil14b" readonly="readonly"></p> </div> </div> <div class="Row"> <div class="Cell"> <p><input type="text" style="width:100%;" name="nama" id="row15" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n43" value="0" id="val43" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n44" value="0" id="val44" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" name="n45" value="0" id="val45" onkeyup="tambah()" maxlength="10"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil15a" readonly="readonly"></p> </div> <div class="Cell"> <p><input type="text" style="width:100%;" id="hasil15b" readonly="readonly"></p> </div> </div> </div> <div style="border:0px;" align="right"> <div class="Row" style="border:0px;"> <div class="Cell" style="border:0px;"> <p>Total Wh = <input type="text" style="width:50%;" id="totalwh" readonly="readonly"></p> </div> <div class="Cell" style="border:0px;"> <p>Total KWh = <input type="text" style="width:50%;" id="totalkwh" readonly="readonly"></p> </div> <div class="Cell" style="border:0px;"> <p><input style="text-align:center;border-radius:5px;" type="button" value="Kosongkan" onclick="refresh()"></p> </div> </div> </div>
hasil nya hanya dua digit desimal tanpa tanda ribuan. Yang ingin saya tanyakan adalah: bagaimana menambah kan titik sebagai ribuan dan koma sebagai desimal
Please help me?
Melihat 1 balasan (dari total 1)
Melihat 1 balasan (dari total 1)
- Topik ‘menambahkan titik koma di javascript’ tertutup untuk balasan baru.