Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

$FNUMBER

1990 Version of ANSI Standard

2.2.7.6 $FNumber

$FN[UMBER] ( numexpr , fncodexpr )

See 2.2.4 for the definition of numexpr.

    fncodexpr::= expr V fncode

See 2.3 for the definition of expr. See section 1 for the definition of V.

    fncode::= fncodatom ...
    fncodatom::=



P
T
,
+
-




       
 
(Note: comma)
 
(Note: hyphen)

returns a value which is an edited form of numexpr. Each fncodatom is applied to numexpr in formatting the results by the following rules (order of processing is not significant):

fncodatom Action
P Represent negative numexpr values in parentheses. Let A be the absolute value of numexpr. Use of fncode "P" will result in the following:
  1. If numexpr < 0, the result will be "("_A_")".
  2. If numexpr '< 0, the result will be " "_A_" ".
T Represent numexpr with a trailing rather than a leading "+" or "-" sign. Note: if sign suppression is in force (either by default on positive values, or by design using the "-" fncodatom), use of fncode "T" will result in a trailing space character.
, Insert comma delimiters every third position to the left of the decimal (present or assumed) within numexpr. Note: no comma shall be inserted which would result in a leading comma character.
+ Force a plus sign ("+") on positive values of numexpr. Position of the "+" (leading or trailing) is dependent on whether or not fncodatom of "T" is specified.
- Suppress the negative sign "-" on negative values of numexpr.

If fncodexpr equals an empty string, no special formatting is performed and the result of the expression is the original value of numexpr.

More than one occurrence of a particular fncodatom within a single fncode is identical to a single occurrence of that fncodatom. Erroneous conditions are produced when a fncodatom "P" is present with any of the sign suppression or sign placement fncodatoms ("T+-").

$FN[UMBER] ( numexpr , fncodexpr , intexpr )

See 2.2.4 for the definition of numexpr. See 2.2.4.1 for the definition of intexpr.

This form is identical to the two-argument form of $FN, except that numexpr is rounded to intexpr fraction digits, including possible trailing zeros, before processing any fncodatoms. If intexpr is zero, the evaluated numexpr contains no decimal point. Note: if (–1 < numexpr < 1), the result of $FN has a leading zero ("0") to the left of the decimal point.

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.

This page most recently updated on 15-Nov-2023, 13:08:50.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)