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

$%FORMAT^STRING

Draft MDC Standard

7.1.6.6.4 $%FORMAT^STRING

FORMAT^STRING : STRING ( IN : STRING , FORMAT : STRING )

    fdirectives::= expr V | fspec [ : fspec ] ... |
    fspec::=





CS = expr
DC = fchar
EC = fchar
FS = expr
FM = fmask
SL = expr
SR = expr






    fchar::= expr V graphic
    erchar::= expr
    fmask::=











c
d
f
l
n
s
x
-
+
SP
(
)












      Currency (left justified)
Decimal (Singular occurrence per mask)
Float either type at end of the run
Left Justified Numeric
Numeric
Separator
Spacer
Display sign if negative
Display sign always
Insert space for the spaces in the mask
Start of negative value
End of negative value

$%FORMAT^STRING returns a copy of IN formatted according to the instructions specified in FORMAT. The value of FORMAT is restricted to be an fdirectives. The meaning of these directives is explained below.

For each of the values below, the function will use the values that are specified. If, in a function call, there is no specification for any of the values below, a default value will be used. The function inherits its defaults from the process (see Clause 7.1.3.5, ^$Job), and the process inherits its defaults from the system (see Clause 7.1.3.9, ^$System).

FM = fmask

This specification provides the actual value for the format mask.

The format mask is a description of the various fields to be output. Should a sign not be specified (+, () or -), the absolute value of IN will be returned.

CS = expr

This specification provides the actual value for the currency string.

The currency string is a string of characters that represents either the single character local currency designator or the multiple character international reference. This string may occur only once in a format specification.

DC = fchar

This specification provides the actual value for the decimal separator character.

The decimal separator is the character that separates the units from the tenths in a numeric string.

EC = erchar

This specification provides the actual value for the error character.

The error character is repeated over the length of the result string when the formatting instructions cannot be applied.

FS = expr

This specification provides the actual value for the fill string.

The fill string is a repeating pattern to be used instead of spaces to fill unused columns.

SL = expr

This specification provides the actual value for the left-hand separator string.

SR = expr

This specification provides the actual value for the right-hand separator string.

The (left-hand and right-hand) separator strings are used to separate the various columns in positions that designate orders of magnitude. The left-hand separators are used for the positions to the left of the decimal separator; the right-hand separators are used for the positions to the right of the decimal separator.

The separator strings must contain one single character for each occurrence of a separator indicator in the format mask.

Click here for $%FORMAT^STRING sample code.

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:16:10.

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