Solved

Calculations with ColdFusion

Posted on 2014-03-21
2
342 Views
Last Modified: 2014-03-21
I need to calculate some fields. first I need to sum B + C and then subject that from A. Does coldfusion support parenthesis  for things like this? Can I do, A - (B+C)? Or, Do I need to add B+C first, make it a separate variable and then subtract it from A?

Thank you!
0
Comment
Question by:earwig75
2 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 39946408
Of course..

<cfset valueA = 4>
<cfset valueB = 10>
<cfset valueC = 15>

<cfset theResult = ValueA - (ValueB + ValueC)>
0
 
LVL 52

Expert Comment

by:_agx_
ID: 39946429
(no points, your question was already answered ... )

> Does coldfusion support parenthesis  for things like this?

Yes. Pretty much any language that supports basic arithmetic operations ie + - * / will, as parenthesis are the standard way of specifying  order of operations.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to access an read a file outside of the web root. 5 32
Most current Records - Query or Query ColdFusion 5 58
CFFILE upload help 98 138
Coldfusion retrieve dynamic values 1 30
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now