[ic] Total-cost is not equal to discounted price plus tax

Jonathan Clark interchange-users@icdevgroup.org
Tue Jan 21 14:32:00 2003


> I'm still have a problem of [total-cost] calculation.
>
> In case of mine, 5% discount for subtotal, and frac_digits 0,
>
> subtotal is 25450 * 0.95 = 24177.5 , rounded is 24178 Yen.
> [subtotal] shows
> 24,178 Yen.
> salestax is 24177.5 * 0.05 = 1208.875 , rounded is 1209 Yen. [salestax]
> shows 1,209 Yen.
>
> What is [total-cost] calculation?
> (A) 24177.5 + 1208.875 = 25386.375, [total-cost] shows 25386 Yen
> (B) 24178 + 1209 = 25387
>
> >From assign tag in IC doc below, [total-cost] shows (A). Is it correct?
> I think [total-cost] should be 25,387Yen.
>
> Am I wrong?

Yes.

You are asking Interchange to _display_ costs rounded, not to calculate
rounded costs.

If you did the equivalent in a spreadsheet, displaying to zero decimal
places, it would behave just like Interchange.

Jonathan.