I am building a cart in Java and would like to give users the ability to update the quantity and see the new price instantly. I am using BigDecimal on the back-end for complete accuracy, but the ajax call introduces a slight delay. It isn't much but I could make the update instant by sending the update to the server and just updating the price in Javascript before it even returns. The speed would be wonderful but it comes at the expense of rounding errors being presented to the user.Now the back-end computed price would be the one shown on the payment page so that would be accurate at least but is the speed worth the risk of a bad value showing in the cart in an eCommerce system?
Ajax call or js to update a cart price
java;javascript;e commerce