A client originally had me set up a large number of pages displaying
prices that could, without altering the database itself, be adjusted up
or down by a percentage - per product category (several hundred
categories).

So, easy enough:

PRICE = #DollarFormat(ST_100.DIST_COST * ADJUST.ADJUST100)#

The percent adjust is set in an admin form.

Now, they want me to go back and change it so they can either adjust
prices up or down by a percent, or add a specific dollar amount to each
price instead.

Using the LEAST amount of code possible, I was hoping to have an
"operator" cell in the database that would just tell it to add the
amount, or multiply the amount. Ideally, I'd LOVE to be able to do this:

PRICE = #DollarFormat(ST_100.DIST_COST #op_variable# ADJUST.ADJUST100)#

...but that obviously won't work.

I'm sorta stumped though....

Only thing I can think of is:

<cfif op_variable = multiply>
    PRICE = #DollarFormat(ST_100.DIST_COST * ADJUST.ADJUST100)#
<cfelse>
   PRICE = #DollarFormat(ST_100.DIST_COST + ADJUST.ADJUST100)#
</cfif>

Anybody have an idea for a shorter way to do this?

--
Les Mizzell
-------------------------
�Mihi placent, O Pincerna!
  Virent ova! Viret perna!
  Dapem posthac non arcebo.
  Gratum tibi me praebebo.�

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to