7.4. New style format strings #

7.4.1. New style format string for strings
7.4.2. New style format string for numeric data
7.4.3. New style format string for monetary data
7.4.4. New style format string for datetime values
7.4.5. New style format string examples

RLIB supported "new style" format strings that allowed formatting numeric data as monetary values and allowed to disambiguate between format strings used for different data types. This was needed because some format flags are used in both printf(), strfmon() and strftime().

7.4.1. New style format string for strings #

This is an extension over RLIB, which didn't have such a notion. In OpenCReports, the new style flag is prefixed with !&.

7.4.2. New style format string for numeric data #

The new style flag is the legacy flag prefixed with !#

7.4.3. New style format string for monetary data #

There was way to format numeric data using the legacy formatting flags. The new style flag is prefixed with !$ and uses the flags of strfmon(). See the strfmon() function for details.

To print the correct currency name, the locale must be set for the report. Only one locale can be set, so a single currency name will be used for every value using monetary formatting.

7.4.4. New style format string for datetime values #

The new style flag is the legacy flags prefixed with !@. Formatting a datetime value uses strftime().

7.4.5. New style format string examples #

Examples for using these in the Text element format attribute can be found in the Format attribute examples.