[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 470
  • Last Modified:

Calculations with ColdFusion

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
earwig75
Asked:
earwig75
1 Solution
 
gdemariaCommented:
Of course..

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

<cfset theResult = ValueA - (ValueB + ValueC)>
0
 
_agx_Commented:
(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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now