mapObj
const mapObj = {
"{1}": "replacement for 1",
"{2}": "different replacement for 2"
};
function process(value) {
return value.replace(/\{\d}/g, m => mapObj[m] || "some default");
}
console.log(process("Testing {1} testing {2}"));
此行引发private void calculateTotalValue() {
DefaultTableModel dtm=(DefaultTableModel) tableDetail.getModel();
double total=0;
for(int i=0;i<dtm.getRowCount();i++){
total =total+(double)dtm.getValueAt(i, 4);
}
totallbl.setText(Double.toString(total));
}
但是我不明白为什么会这样?