View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > DecimalFormat PreviousNext

DecimalFormat

Converts a number to a decimal-formatted string.

A number as a string formatted with two decimal places and a thousands separator.

Display and formatting functions

DecimalFormat(number)

DollarFormat, NumberFormat

Parameter

Description

number

Number to format

<h3>DecimalFormat Function</h3>
<p>Returns a number to two decimal places.
<p>
<cfloop FROM = 1 TO = 20 INDEX = "counter">
   <cfoutput>
   #counter# * Square Root of 2: 
      #DecimalFormat(Evaluate(counter * sqr(2)))#
   </cfoutput>
   <br>
</cfloop>

Contents > CFML Reference > ColdFusion Functions > DecimalFormat PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


oneishy said on Jun 29, 2004 at 3:34 AM :
Be careful with this, it converts the number to a string that won't be accepted by other functions that require numbers, such as DecimalFormat().
Bryan_Hogan said on Apr 6, 2005 at 8:42 AM :
If you pass an empty string into decimalFormat() it will return 0.00 and not throw an error.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi68.htm