Hi,
I'm building a webapp using JQuery, Stripes, Spring and JPA (Hibernate).
I have a page that allows users to enter a number of order line items and each time onblur occurs in the price field, I have a JQuery event bound to the field which sums all the price fields (this is a subtotal), calculates 10% tax and adds the tax to the subtotal. I update the page to display the subtotal, tax and grand total.
My question is, should I be doing this calculation in Javascript? If so, how can I be sure the rounding etc is working correctly? I'm a bit worried about problems with precision.
Would it be better for me to make an Ajax call to do the calculation in Java?
Any advice would be great!