# Release: InData 6/7.1.8 for InDesign CS4/CS5

This release sees the addition of sister-product Xdata’s format() function, support for the &it tag in XPress Tags-styled text and compatibility with InCatalog 6/7.2.8.1 and later.

### Changes

- Added support for the &it tag in XPress Tags-styled text, which provides full support for all native InDesign Tags (including indexing marks and hyperlinks).
- Added compatibility with InCatalog 6/7.2.8.1‘s Unicode-based key, field and price style names.
- Added
`format(`

, a number formatting function (abbreviable as*number*,*pattern*)`fmt`

) that works as follows:*number*is given as a string containing a raw number to format. All characters other than “-“, the decimal digits and the decimal marks are removed from the string before processing. Any digits found before the first decimal mark are used as the “whole” part of the number and any found after are used as the “fractional” part.*pattern*is given as a string containing the pattern describing how to format the given*number*, in a form similar to Excel’s numeric format strings. For example, for- a number, whole part only, use “-#,##0” or “-0”
- a number, fractional part only, use “.#” or “.00”
- a number, both whole and fractional part, use “-#,##0.#” or “-0.#”
- dollars and cents (2-digit precision for the fractional part), use “-#,##0.00” or “-0.00”
- a social security number, use “000-00-0000”
- a phone number, use “000-0000” or “(000) 000-0000”
- a zip code, use “00000-0000” or “00000”

(Date, time, and scientific formats are currently not supported.)

There are several characters that are treated specially when they are found in

*pattern*: “-“, “#”, “0”, the (locale-dependent) thousands separator and the (locale-dependent) decimal mark. Any other characters found in*pattern*will be placed literally without further processing. The “-” character is treated differently only if it occurs before any other special character. If this is the case, then it will appear in the output only if the*number*given is negative. The “-” sign is never displayed unless it appears in the pattern. The first decimal mark to appear in*pattern*acts as a divider between the*whole number*pattern on the left and the*fractional number*pattern on the right. All other decimal marks are treated as ordinary characters. All instances of the thousands separator are ignored, but if one is found it indicates that that mark should be inserted after every third digit in the whole number output starting from the right.The “0” (zero) and “#” marks are

*placeholders*for the digits given by*number*. “0” is a*hard*placeholder (always must appear, “0” if no data exists), and “#” is a*soft*placeholder (appears only if there is a corresponding digit in*number*).In the

*whole number*pattern, placeholders are filled right-to-left. Any digits that do not have a placeholder are placed immediately to the left of the first placeholder found in the pattern. If no placeholder exists, then all the whole digits in*number*are ignored.In the

*fractional number*pattern, placeholders are filled in left-to-right. The number of fractional digits displayed must always be between the bounds [*number of hard placeholders*,*number of placeholders*]. If the number of actual digits falls between these bounds, then the digits will all be displayed and any extra soft placeholders will be removed. If digits are truncated because not enough placeholders exist, then the portion that is kept will be rounded, except when all its digits are “9”s, in which case the extra digits are simply truncated (The fractional part of the number is never allowed to carry over to the whole part.)The decimal mark itself will only be displayed when both the whole number portion of the pattern is not empty and data exists in the fractional part of the output. This behavior allows the format function to be called separately to output the whole and fractional portions of

*number*, like$«format(price, "-#,##0")».«format(price, ".00")»

where the

`"."`

in`".00"`

(in the second call to`format`

) won’t be output, since the whole number portion is empty. - Added a “Latest News…” menu entry that opens the InData/Xdata news web page.