On Mon, 28 Apr 2008 10:20:46 +0200, ian douglas <[EMAIL PROTECTED]> wrote:

Well, may be that i missed the answer but someone asked if the discount and the extra stuff are applied only to the 10 pack or it could also be a 12 pack?
So to let you understand the condition is:
 if (phones_ordered == 10)
    do_the_10_pack_trick();

More like:

if (phones_ordered && phones_ordered % 10 == 0)
        do_the_10_pack_trick();

I just can't leave it like that. :-)

if (phones_ordered % 10 * PRICE_1 > PRICE_10_PACK)
    phones_ordered += 10 - phones_ordered % 10;
for (; phones_ordered >= 10; phones_ordered -= 10)
    do_the_10_pack_trick();
for (; phones_ordered >= 1; phones_ordered--)
    no_tricks_just_order_1();


--
Alexey Feldgendler <[EMAIL PROTECTED]>
[ICQ: 115226275] http://feldgendler.livejournal.com

_______________________________________________
Openmoko community mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/community

Reply via email to