FormatNumberComplete ( number, format )
Rate this function: Average rating: 4.0 (7 votes)
Discuss this Custom Function
Lewis C. Lorenz, Lorenz Companies
Returns text string of number in the requested format. Function allows complete FileMaker Pro number formatting using an intuitive format structure.
|FormatNumberComplete ( 14725.3675, “$,.2 US” )
FormatNumberComplete ( -14725.3675, “$(,.2) US\r0\” )
FormatNumberComplete ( -14725.3675, “#,.\c255\” )
FormatNumberComplete ( 1, “Yes\/No” ) =
$(14,725.36) US [rounding off]
#-14,725.3675 [text color is red]
FormatNumberComplete ( number, format )
Returns text string of number in the requested format.
by Lewis C. Lorenz
number = number to format.
format = format string.
Function allows complete FileMaker Pro number formatting using an intuitive format structure. Inclusion, and placement, of the following characters in the format string controls the resulting formatted number string.
, (comma/thousands separator) = integer portion of the number is "thousands separated".
. (period/decimal point) = controls display of the number decimal when used in conjunction with included, or omitted, # (number).
# (number) = controls the count of digits of the number decimal to display (also specifies the rounding precision):
0 = Number decimal and decimal point is not displayed. Enables positioning of negative signs and notations.
1 ... n = Truncation and rounding precision of the number decimal.
"" = Decimal point with no number displays the unaltered number decimal.
Negative signs control the formatted result of negative numbers. The signs listed below are in order of precedence. Any lower-precedence signs also in the format string are ignored during processing and do not appear in the formatted result. Minus sign, credit and delta symbols can be displayed on the left or right of the formatted number by placing them to the left or right of an included decimal point in the format string. Negative signs will be placed at their default location when no decimal point is included.
- = Minus sign (default). Default position is at the left.
<> = Angle brackets. Surrounds the number.
() = Parentheses. Surrounds the number.
CR = Credit symbol. Default position is at the right.
∆ = Delta symbol. Default position is at the left. (Darkened triangle is used.)
\/ = escaped fore-slash divides boolean results. Left side is returned if number is true, right side is returned if number is false.
Percent, currency and other notations can be placed on either side of the formatted number depending on whether you place them at the left or right of an included decimal point in the format string. Notations will be placed at their default position when no decimal point is included.
% = Percent sign. Inclusion in format string forces multiplication of the number by 100 during processing. Default position is at the right.
$, #, etc. = Dollar and pound signs, and other characters, can be included in your formatted number. Default position is at the left.
Escaped characters can be used to override defaults and add formatting. Enclose each passed option in an ending escape (backslash).
\T = thousands separator. Default is , (comma).
\D = decimal point. Default is . (period).
\R = Round to passed precision (default is true).
\Z = Show number if zero (default is true).
\F = Fill decimal with zeros to length of passed precision (default is true).
\SL = Negative sign to appear on left side of number (default is minus sign).
\SR = Negative sign to appear on right side of number.
\NL = Notation to appear on left side of number.
\NR = Notation sign to appear on right side of number.
\PL = Proximity of negative sign on left side of number (default is next to number).
\PR = Proximity of negative sign on right side of number (default is next to number).
\C = Comma separated RGB number string to return colored negative number.
FormatNumberComplete ( 14725.3675, "$,.2 US" ) = $14,725.37 US
FormatNumberComplete ( -14725.3675, "$(,.2) US\r0\" ) = $(14,725.36) US [rounding off]
FormatNumberComplete ( -14725.3675, "#,.\c255\" ) = #-14,725.3675 [text color is red]
FormatNumberComplete ( 1, "Yes\/No" ) = Yes
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:
Newest Custom Functions:
||ErrorDescription v13 ( errorNumber )
||(Sun, Dec 08, 3:23pm)
||(Mon, Dec 02, 8:33pm)
||Omit ( text ; string )
||(Mon, Dec 02, 2:01pm)
||PayRef ( reference )
||(Tue, Nov 26, 2:29am)
||IsPlainText ( text )
||(Thu, Nov 14, 4:14pm)
||NumToCText ( number )
||(Mon, Nov 11, 2:36pm)
||resolve ( name )
||(Mon, Nov 11, 7:08am)
||fnBMI ( Height ; Weight )
||(Sun, Nov 10, 8:14am)