function calculateFinalPrice() {
var price = parseFloat(document.getElementById(‘casio_price’).value);
var discount = parseFloat(document.getElementById(‘casio_discount’).value);
if (!isNaN(price) && !isNaN(discount)) {
var finalPrice = price – (price * (discount / 100));
document.getElementById(‘final_price’).value = finalPrice.toFixed(2);
} else {
alert(“Please enter valid values.”);
}
}