Format AttributeA new attribute, FORMAT, is optional with many meta tags. It specifies how the output of the tag should be formatted. All tags with an optional FORMAT attribute accept a format string of the form FORMAT=class:format, as detailed following. CASE: Case ReformattingText can be converted as follows:
Words are defined as a sequence of non-whitespace characters delimited by whitespace. NUM: Numeric FormattingNumbers with at least one whole digit and optional fractional digits can be reformatted. The format is specified by a comma-delimited list of values in this order: FORMAT=num: grouping,
All eight items must be present, either with a specified value or nothing. For example, if you do not want any formatting for fractional digits there would be nothing between the commas, (,,). You must address each of the eight items in the number formatting string, even if it is just to let Tango know not to do anything with one or more of the eight numerical formatting items in the list. Each list item may be a maximum of 15 characters long. Spaces and case are significant. The list items are described as follows:
This example repeats a grouping of "3". This example groups six digits, beginning from the right, into three separate groups, one of three ("3") digits, one of one ("1"), and one of two ("2").
Do not include spaces unless they are intended. Commas, single quotes, and double quotes can be included by backslash-escaping (for example, \, or \"), or enclosing them in single or double quotes (for example, "," or `''). Anything following a backslash is taken literally. Here are some examples of numeric formats. -1234.56 is formatted as:
SynonymsThere are synonyms provided for commonly used format strings. Example synonyms are listed in the table following with formatted string, -1234567.890. *US = United States and CA=Canada. TEL: Telephone NumbersThis formatting accepts as input text a sequence of digits, spaces, or punctuation marks, and outputs the digits in one of the following requested formats:
*US = United States and CA=Canada. DATETIMEThe FORMAT attribute accepts the "%-" specifiers used by the dateFormat configuration variables, with the addition of a datetime: prefix. For example, datetime:%Y-%m-%d would specify an ODBC-style date (December 1st, 1998 would be formatted as "1998-12-01"). For more information, see "dateFormat, timeFormat, timestampFormat". Tango attempts to guess what the date/time entered actually is. First, the dateFormat, timeFormat, and timestampFormat configuration variables are used to test the input string for a perfect match, and failing these, the procedures as used by the <@ISDATE> family of tags are tested. If the input cannot be determined, a warning is logged and reformatting does not take place. Tags that accepted a format attribute in previous versions of Tango--<@CURRENTTIME>, <@CURRENTIMESTAMP>, and <@CURRENTDATE>--can be used with the new FORMAT attribute or with their old formatting. There is only one datetime-class synonym: datetime:http. datetime:http = datetime:%A, %d-%b-%Y %H:%M:%S GMT. For more information, see "<@TOGMT>". For example, if the string 1998-09-29 12:34:56 were formatted with datetime:http, the output format would be "Monday, 29-Sep-1998 12:34:56 GMT".
|
Copyright © 1998, Pervasive Software Inc. All rights reserved.