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

  1. <!--- This example shows the use of NumberFormat --->
  2. <HTML>
  3.  
  4. <HEAD>
  5. <TITLE>
  6. NumberFormat Example
  7. </TITLE>
  8. </HEAD>
  9.  
  10. <BODY bgcolor=silver>
  11.  
  12. <H3>NumberFormat Example</H3>
  13.  
  14. <CFLOOP FROM=1000 TO=1020 INDEX="counter">
  15. <CFSET CounterRoot2 = #Evaluate("#counter# * #sqr(2)#")#>
  16.  
  17. <!--- Show the result in default format, adding the comma
  18. for the thousands place, and also in custom format,
  19. displaying to two decimal places --->
  20. <CFOUTPUT>
  21. <PRE>#counter# * Square Root of 2: #NumberFormat("#CounterRoot2#", '_____.__')#</PRE>
  22. <PRE>#counter# * Square Root of 2: #NumberFormat("#CounterRoot2#")#</PRE>
  23. </CFOUTPUT>
  24. </CFLOOP>
  25.  
  26.  
  27.  
  28.  
  29. </BODY>
  30.  
  31. </HTML>       
  32.