Initializing help system before first use

Entity Formatting

The Xpress Insight API provides a display formatter that can make formatting consistent for numeric and other data.

The insight.Formatter object holds the default formats for different numeric data types (integer and real) and provides a formatting method insight.Formatter.formatNumber() that can be applied to any data within your view code. Model entities can be formatted according to their data type (or element data type, in the case of arrays) by using the insight.Formatter.formatEntityValue() method. If the entity is a set and has an associated labels entity, you can get the formatted label value using the insight.Formatter.getFormattedLabel() method.

You can also supply a custom formatter on a per-entity basis. To do this, use the insight.Formatter.setEntityFormatter() method. Any occurrence of this entity will then be formatted using your custom formatting function.
Note In setting a custom formatter for an entity, it will override any standard formatting.
After an entity formatter has been set, the Xpress Insight components automatically apply formatting on the specified entities when they are displayed in an AutoTable or AutoText component.
// Arrays and sets only; in this case 'Array1' is an array.
insight.Formatter.setEntityFormatter('Array1', function(original) {
    return insight.Formatter.formatNumber(original, '$#,##0.0#', null);
});
Note See insight.Formatter in the JavaScript API documentation for function signatures and other details.

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.