472
CFML Language Reference
Note
If you do not specify a sign for the mask, positive and negative numbers
will not align in columns. As a result, if you expect to display both positive
and negative numbers in your application, use either the space or use -
(minus sign) to force a space in front of positive numbers and a minus
sign in front of negative numbers.
Usage
The position of codes in format masks determines where those codes will have effect.
For example, if you place a dollar sign character at the far left of a format mask,
ColdFusion displays a dollar sign at the very left edge of the formatted number. If you
separate the dollar sign on the left edge of the format mask by at least one underscore,
ColdFusion displays the dollar sign just to the left of the digits in the formatted
number.
In all examples below, the numbers under the masks and the formatted output are
used to clearly show the positions of characters.
This positioning idea can also be used to show where to place the - (minus sign) for
negative numbers:
There are four possible positions for any code character: far left, near left, near right,
and far right. The left and right positions are determined by the side of the decimal
point the code character is shown on. For formats that do not have a fixed number of
decimal places, you can use a ^ (caret) to separate the left fields from the right.
Whether the code is placed in the far or near position is determined by the use of _
(underscore). Most code characters will have their effect determined by which of these
Number
Mask
Result
4.37
$____.__
"$ 4.37"
4.37
_$___.__
" $4.37"
12345678
12345678
Number
Mask
Result
-4.37
-____.__
"- 4.37"
-4.37
_-___.__
" -4.37"
12345678
12345678
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...