[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: percentage discount not calculating properly*From*: Luke <..hidden..>*Date*: Thu, 25 Feb 2010 01:17:21 -0500 (EST)

On Wed, 24 Feb 2010, Chris Travers wrote:

On Wed, Feb 24, 2010 at 6:50 PM, Bob Miller <..hidden..> wrote:your test: quantity 7, unit price $100.050, discount 15%, extended price $595.29. my calculator says: 7*100.05*.85=595.2975, so I think the correct answer should be $595.30...change the price to $100.0500 and you will get an extended price of $595.30

However...

Could we draw that from a default setting instead?

This is Easier for me than for Bob's client, I imagine.

$form->{total} += $linetotal; To: $form->{total} += $form->round_amount($linetotal, 2);

1.05 with a 91% discount (1.05 - (1.05 * 0.91)) = 0.0944999999999999 It should be 0.0945. (perl -e 'print 1.05 - (1.05 * 0.91), "\n";')

my $discount = $form->round_amount($sellprice * $form->parse_amount( $myconfig, $form->{"discount_$i"} ) / 100, $decimalplaces); Luke

**Follow-Ups**:**Re: percentage discount not calculating properly***From:*Chris Travers

**References**:**percentage discount not calculating properly***From:*Bob Miller

**Re: percentage discount not calculating properly***From:*Chris Travers

**Re: percentage discount not calculating properly***From:*Bob Miller

**Re: percentage discount not calculating properly***From:*Chris Travers

**Re: percentage discount not calculating properly***From:*Luke

**Re: percentage discount not calculating properly***From:*Chris Travers

**Re: percentage discount not calculating properly***From:*Luke

**Re: percentage discount not calculating properly***From:*Chris Travers

**Re: percentage discount not calculating properly***From:*Chris Travers

**Re: percentage discount not calculating properly***From:*Bob Miller

**Re: percentage discount not calculating properly***From:*Chris Travers

- Prev by Date:
**Re: ls13 beta3 and initiate.pk error** - Next by Date:
**Re: percentage discount not calculating properly** - Previous by thread:
**Re: percentage discount not calculating properly** - Next by thread:
**Re: percentage discount not calculating properly** - Index(es):