User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 331,472 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,039 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:
Dec 23rd, 2004
Views: 2,403
this application shows you how to declare variables and display variables. the end result of this code is showing you the total price after tax. this is mainly for beginners.
coldfusion Syntax | 5 stars
  1. <cfset nTax = .05 />
  2. <cfset nPrice = 5.95 />
  3. <cfset nTotal = nTax * nPrice + nPrice />
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  8. <title>Variables</title>
  9. </head>
  10.  
  11. <body>
  12. <cfoutput>Price: #nPrice#</cfoutput><br>
  13. <cfoutput>Tax: #nTax#</cfoutput><br>
  14. <cfoutput>Total: #nTotal#</cfoutput>
  15.  
  16.  
  17. </body>
  18. </html>
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 8:40 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC