Fix issue #21

In issue #21 was reported that sales item pricing based on total price.
I examine the problem and determine that sometimes you want to base the
pricing on unit price and sometimes on total price.  I implement it this
way:

- if the user selects the same unit in step 3 as in step 1 she probably
  wants to sell the sales item basing on the unit price
- if she selects another unit in step 3 she probably wants to sell it
  basing on the total price

Furthermore, I implement handling of NaN values when calling
formatCurrencyValue().