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

$FNUMBER

Draft MDC Standard

7.1.5.8 $FNumber

$FN[UMBER] ( numexpr , fncodexpr )

    fncodexpr::= expr V fncode
    fncode::= [ fncodatom ... ]
    fncodatom::=



fncodp
fncodp
,
+
-




       
 
(Note: comma)
 
(Note: hyphen)
    fncodp::=

p
P


    fncodt::=

t
T


This form shall return a value that is the value of numexpr edited by applying each fncodatom according to the following rules. The order of application is not significant:

fncodatomAction
fncodp Represent negative numexpr values in parentheses. Let A be the absolute value of numexpr. Use of fncodp will result in the following:
  1. If numexpr < 0, the result will be "("_A_")".
  2. If numexpr '< 0, the result will be " "_A_" ".
fncodt 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 fncodt 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 fncodt is present.
- Suppress the negative sign "" on negative values of numexpr.

All other values for fncodatom are reserved. Note: Zero is neither positive nor negative.

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. An error condition occurs, with ecode = "M2", when a fncodp is present with any of the sign suppression or sign placement fncodatoms ("+" or fncodt).

Note: if (1 < numexpr < 1), the result of $FNumber(numexpr,fncodexpr) does not have a leading zero ("0") to the left of the decimal point.

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

This form is identical to the two-argument form of $FNumber, 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 this form of $FNumber has a leading zero ("0") to the left of the decimal point. Negative values of intexpr are reserved for future extensions to the $FNumber function.

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.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

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

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