Solved

Calculations with ColdFusion

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

20 Experts available now in Live!

Get 1:1 Help Now