home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / dollarformat.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  818 b   |  27 lines

  1. <!--- This example shows the use of DollarFormat --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. DollarFormat Example
  6. </TITLE>
  7. </HEAD>
  8.  
  9. <BODY bgcolor=silver>
  10. <H3>DollarFormat Example</H3>
  11.  
  12. <CFLOOP from=8 to=50 index=counter>
  13. <CFSET #full# = #counter#>
  14. <CFSET #quarter# = #Evaluate("#counter# + (1/4)")#>
  15. <CFSET #half# = #Evaluate("#counter# + (1/2)")#>
  16. <CFSET #threefourth# = #Evaluate("#counter# + (3/4)")#>
  17. <CFOUTPUT>
  18. <PRE>
  19. bill    #DollarFormat("#full#")#    #DollarFormat("#quarter#")#    #DollarFormat("#half#")#  #DollarFormat("#threefourth#")#
  20. 18% tip    #DollarFormat("#Evaluate("#full# * (18/100)")#")#    #DollarFormat("#Evaluate("#quarter# * (18/100)")#")#    #DollarFormat("#Evaluate("#half# * (18/100)")#")#    #DollarFormat("#Evaluate("#threefourth# * (18/100)")#")#
  21. </PRE>
  22. </CFOUTPUT>
  23. </CFLOOP>
  24.  
  25. </BODY>
  26. </HTML>       
  27.