DecimalFormat

Description

Converts a number to a decimal-formatted string.

Return value

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

Category

Display and formatting functions

Syntax

DecimalFormat(number)

See also

DollarFormat, NumberFormat

Parameters

Parameter Description
number
Number to format

Example

<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>

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

Version 6

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

 

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

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt168.htm