Chaps,
I'm looking for the best way to make a positive number into a negative one,
so if I have '10' I'm looking to convert that to '-10' what's the best way
to achieve this?
Thanks,
Rob
~|
ColdFusion MX7 and Flex 2
Multiply by -1 =)
Chris
~|
ColdFusion 8 beta â Build next generation applications today.
Free beta download on Labs
http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta
Archive:
On Wednesday 13 Jun 2007, Robert Rawlins - Think Blue wrote:
I'm looking for the best way to make a positive number into a negative one,
so if I have '10' I'm looking to convert that to '-10' what's the best way
to achieve this?
Subtract itself twice.
--
Tom Chiverton
Helping to
0 minus your number works too. To ensure a negative number, use abs():
cfset var1 = 0 - abs(numVar) /
Jake
~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 MX7 integration create powerful cross-platform RIAs
: Make Number Negative
Chaps,
I'm looking for the best way to make a positive number into a negative one, so
if I have '10' I'm looking to convert that to '-10' what's the best way to
achieve this?
Thanks,
Rob
~|
CF 8
cfset var1 = 0 - abs(numVar) /
Why make it simple ?
How about this:
CFSET var = Log (1/exp(x)) ;-)
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
6 matches
Mail list logo