我想舍入来自“ document.getElementById('Edit_total_price')。value = result1;”的结果到javaScript中的两个小数位。这是我的整体代码
function edit_calculate() {
var myBox1 = document.getElementById('Editprevious_reading').value;
var myBox2 = document.getElementById('Editcurrent_reading').value;
var myBox3 = document.getElementById('Edit_total_sale').value;
var Edit_total_sale = document.getElementById('Edit_total_sale').value;
var myResult = myBox2 - myBox1;
var result1 = document.getElementById('price').value * myResult;
document.getElementById('Edit_total_sale').value = myResult;
document.getElementById('Edit_total_price').value = result1;
}