I have a project in which I must create a shopping cart with multiple options such as adding certain amounts of items to the cart. Everything is working correctly except when the user prompts for the total of the cart. It will output a crazy number e.g. $15.9614.9500000000000000013.0.
This is the code used to print out the total. All the values are doubles. Any help?
System.out.println("Your total comes to $" +
(dynamicRope * dynamicRopeCost) +
(staticRope * staticRopeCost) +
(webbing * webbingCost));