Use the MODULO function to get the remainder.
r = QTY % 12
Along with the quotient.
q = QTY / 12
(q * 26.00) + ( {lookup what the price is for r items} )
Beverly
On 10/17/08 9:17 AM, WebDude [EMAIL PROTECTED] wrote in whole or in
part:
Having a hard time wrapping my head
You count the full cases first,multiply by case price, then add the
value associated with the remainder.
Sent from my iPhone
On Oct 17, 2008, at 8:17, WebDude [EMAIL PROTECTED] wrote:
Having a hard time wrapping my head around this one. Any help would
be appreciated.
Let's say we have
, October 17, 2008 8:47 AM
To: witango-talk@witango.com
Subject: Re: Witango-Talk: One for the Math Gurus
Use the MODULO function to get the remainder.
r = QTY % 12
Along with the quotient.
q = QTY / 12
(q * 26.00) + ( {lookup what the price is for r items} )
Beverly
On 10/17/08 9:17
To: witango-talk@witango.com
Subject: Re: Witango-Talk: One for the Math Gurus
Use the MODULO function to get the remainder.
r = QTY % 12
Along with the quotient.
q = QTY / 12
(q * 26.00) + ( {lookup what the price is for r items} )
Beverly
On 10/17/08 9:17 AM, WebDude [EMAIL PROTECTED
To: witango-talk@witango.com
Subject: RE: Witango-Talk: One for the Math Gurus
Sorry if I am dense, Beverly, but I am not able to get this to work. It kind
of half works.
Here is what I am doing...
@ASSIGN r @CALC '@ARG QTY % 12'
@ASSIGN q @CALC '@ARG QTY / 12'
@CALC (@VAR q * 26.00
Thanks everyone for your help... I got it working...
@ASSIGN q '@CALC EXPR=floor(@ARG quantity/12) PRECISION=0'
@ASSIGN r '@CALC EXPR=@ARG quantity%12'
@CALC EXPR=(@VAR q * 26)+(@COLUMN 'shippingprice.price')
PRECISION=2