--------------------------------------
Problem (short description)
---------------------------------------
if I set a variable, e.g. DISCOUNT, to equal
EVALUATE(NUMBERFORMAT(ORDERTOTAL - 100000)*0.1)) how do I then
recalculate ORDERVALUE less the discount?
----------------------------
(Longer description)
-----------------------------
I have stored in an Access database a table of discount schemes that
apply to orders.
These consist of 3 fields: ID (autonumber), DISCOUNTSCHEME (text, for
display purposes on the order page), and FORMULA (memo, which includes
the actual formula for coldfusion to apply to the order)
I have got this to work when displaying the results of the formula, but
if I try to apply and further formatting (e.g. adding tax) in the
coldfusion page, I get really strange numbers as the result.
e.g. I have the following stored in FORMULA for one scheme:
(numberformat((ordertotal - 1000)* 0.1))
this basically gives a 10% discount on any order amounts after �1,000.
so if i have an order value of �2,000 it takes 10% off of the second
�1,000 and the formula results in �100 discount - this works fine
But if I try to actually reduce the ordrevalue by this amount, I hit
problems
<cfset discount=evaluate(getdiscount.FORMULA)>
<cfset ordertotal=ordertotal-discount>
This returns astronomical figures, sometimes even negative amounts.
It seems to me that this is a simple problem, and when i set discount,
it is actually setting it to the formula itself rather than the result.
Is this right, and if so how do I get around it??
Thanks
Seth Ward
________________________________________________________________________
This message has been checked for all known viruses, by Star Internet,
delivered through the MessageLabs Virus Control Centre.
For further information visit:
http://www.star.net.uk/stats.asp
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message
to [EMAIL PROTECTED] with 'unsubscribe' in the body.