Initializing help system before first use

Formatting the Optimal Result with JavaScript

The Xpress Insight JavaScript API enables you to invoke a wide range of library functions from within VDL.

You can also create your own JavaScript functions within VDL via <script> blocks, but here, the Return scalar is formatted via a call to an existing function—insight.Formatter.formatNumber—which takes two arguments:

  • the value to be formatted (here, this is the value of scenario.entities.Return.value), and
  • a Java-style formatting string.
  1. If it is not already active in Workbench, open the Portfolio.vdl file.
  2. On the artboard, select the Text field "=scenario.entities.return.value".
  3. In the Attributes pane, edit the Text attribute. Delete the existing entry and replace it with the following JavaScript instruction.
     =insight.Formatter.formatNumber(scenario.entities.Return.value, '00.##')
  4. Republish the app to see the changes.

© 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.