home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows the use of DollarFormat --->
- <HTML>
- <HEAD>
- <TITLE>
- DollarFormat Example
- </TITLE>
- </HEAD>
-
- <BODY bgcolor=silver>
- <H3>DollarFormat Example</H3>
-
- <CFLOOP from=8 to=50 index=counter>
- <CFSET #full# = #counter#>
- <CFSET #quarter# = #Evaluate("#counter# + (1/4)")#>
- <CFSET #half# = #Evaluate("#counter# + (1/2)")#>
- <CFSET #threefourth# = #Evaluate("#counter# + (3/4)")#>
- <CFOUTPUT>
- <PRE>
- bill #DollarFormat("#full#")# #DollarFormat("#quarter#")# #DollarFormat("#half#")# #DollarFormat("#threefourth#")#
- 18% tip #DollarFormat("#Evaluate("#full# * (18/100)")#")# #DollarFormat("#Evaluate("#quarter# * (18/100)")#")# #DollarFormat("#Evaluate("#half# * (18/100)")#")# #DollarFormat("#Evaluate("#threefourth# * (18/100)")#")#
- </PRE>
- </CFOUTPUT>
- </CFLOOP>
-
- </BODY>
- </HTML>
-