Format

The Format accessor (class IlvFormatAccessor) can be used to convert a numeric value of type Double to a character string using a user-specified format. The formatted string is then copied to another accessor. The format of the value is specified by the Format parameter, which is defined in the C library function printf. The numeric value is passed to the conversion function as an IlDouble, so the format should contain a %g specifier.

Parameters

  • Format (printf-style): Format string as defined by the printf C library function and must be a String value. This string must contain at least one %g, since this accessor can only convert values of type Double.

  • Max # of chars: Maximum length of the string after the conversion. If this length is exceeded, the value is replaced by * characters. It must be an Integer value.

  • Attribute: Attribute to which the formatted value is assigned.

Example

In the display prototype in the samples prototype library, the Format accessor allows you to change in NumberField.label the way the value is displayed.