Caché ObjectScript Reference
$MVFMT
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Performs MultiValue formatting of a string or numeric.
Synopsis
$MVFMT(exp,format)
Parameters
exp The value to be formatted. An expression that resolves to a numeric value or a quoted string.
format The formatting code. A quoted string consisting of positional letter and number codes specifying the display format for exp.
Description
The $MVFMT function invokes the Caché MVBasic FMT function, and returns the resulting value to the Caché ObjectScript environment. Specify parameter values in MVBasic form. For further details refer to the Caché MultiValue Basic Reference.
Examples
The following example formats 12345 as a fractional number by adding a decimal point and zero padding it with four fractional digits:
  WRITE $MVFMT(12345,"R4")
 
The following example formats 12345 as a fractional number. The decimal point is moved three positions to the left, and the result is rounded to two fractional digits:
  WRITE $MVFMT(12345,"R27")
 
The following example formats 12345 as a date. Note that it uses MultiValue date counting (where 1 = January 1, 1968) rather than Caché $HOROLOG date counting (where 1 = January 1, 1841):
  WRITE $MVFMT(12345,"D")
 
The following example formats 12345 as a right-justified string of ten characters, using ^ as a fill character:
  WRITE $MVFMT(12345,"10^R")
 
See Also