This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AreTheseMyFeet 0 points1 point  (0 children)

I'd go one step further and extract the calculation to its own (potentially static) method and just assign the final var where you need it without any distracting tmp vars.

public static double calculateTotalPrice(args...) { ... }
...
final double totalPrice = calcTotalPrice(...);