Solved

Calculations with ColdFusion

Posted on 2014-03-21
2
363 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

838 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