pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

cfm private pastebin - collaborative debugging tool What's a private pastebin?


Posted by BenNadelPost on Thu 10 Jul 16:35
report abuse | download | new post

  1.         <cffunction name="getFormattedPrice" output="false" access="public" hint="I format a price">
  2.                 <cfset var price = 0 />
  3.                 <cfif len( trim( getPrice() ) ) >
  4.                         <cfset price = getPrice() />
  5.                 </cfif>
  6.                 <cfreturn LSCurrencyFormat( price )  />
  7.         </cffunction>
  8.  
  9.         <cffunction name="getFormattedSavingsPercent" output="false" access="public" hint="I format the difference between the price and the disc price (aka the discounted amount )">
  10.                 <cfset var savingsPercent  =  0 />
  11.                 <cfif calculateSavings() GT 0 >
  12.                         <cfset savingsPercent = getPrice()/calculateSavings() />
  13.                 </cfif>
  14.                 <cfreturn "%#decimalFormat(savingsPercent)#"/>
  15.         </cffunction>
  16.  
  17.  
  18.         <cffunction name="getFormattedDiscPrice" output="false" access="public" hint="I format a Discprice">
  19.                 <cfset var Discprice = 0 />
  20.                 <cfif len( trim( getDiscPrice() ) ) >
  21.                         <cfset Discprice = getDiscPrice() />
  22.                 </cfif>
  23.                 <cfreturn LSCurrencyFormat( Discprice )  />
  24.         </cffunction>
  25.  
  26. <cffunction name="calculateSavings" output="false" access="public" hint="I get the savings amount from the price and disc price">
  27.                 <cfset var savings  = 0 />
  28.                 <cfif  val( getPrice() ) GT 0>
  29.                         <cfset savings = getPrice() - val( getDiscPrice() ) >
  30.                 </cfif>
  31.                 <cfreturn savings />
  32.         </cffunction>
  33.        
  34.         <cffunction name="isDiscounted" access="public" output="false">
  35.                 <cfreturn getPrice() IS NOT getDiscPrice() >
  36.         </cffunction>
  37.  
  38.         <cffunction name="getFormattedSavings" output="false" access="public" hint="I format the difference between the price and the disc price (aka the discounted amount )">
  39.                 <cfreturn LSCurrencyFormat( calculateSavings() )  />
  40.         </cffunction>
  41.        
  42.         <cffunction name="getPrice" access="public" output="false">
  43.                 <cfreturn variables.instance.price>
  44.         </cffunction>
  45.  
  46.         <cffunction name="setPrice" access="public" output="false">
  47.                 <cfargument name="price" required="true">
  48.                 <cfset variables.instance.price = arguments.price>
  49.         </cffunction>
  50.  
  51.         <cffunction name="getDiscPrice" access="public" output="false">
  52.                 <cfreturn variables.instance.discPrice>
  53.         </cffunction>
  54.  
  55.         <cffunction name="setDiscPrice" access="public" output="false">
  56.                 <cfargument name="discPrice" required="true">
  57.                 <cfset variables.instance.discPrice = arguments.discPrice>
  58.         </cffunction>

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me