Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / April 2005



Tip: Looking for answers? Try searching our database.

CF Calculation Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ganesha - 29 Apr 2005 16:50 GMT
I have running into problems with a commissions calculation  app i am working
on.
Currently I take the amount and apply a percentage to it to get the commission
amount, works great and accuratly  as long as  its a  base number like 1,2,3,
or 4 etc if decimals are used like 2.5 it errors  because my  code which  looks
like

<cfset commamount = getrecord.comm_amount * ".0#getrecord.comm_perc#">

Is using a decimal in the Cfset to  get the proper amount.
Anyone know of any way to do this calculation without forcing the .0 in the
commission percent variable?

Thanks
Mike
adonis1976 - 29 Apr 2005 16:55 GMT
Can you do something like this?

<cfset commamount = (getrecord.comm_amount) * (getrecord.comm_perc/100)>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.