Skip to main content
Definition: ModelCenter/src/ModelCenter.odl (line 6131) Allows you to do custom formatting the same way ModelCenter does. Example:

Members

Public functions

Function setFormat

Sets the format string to use in this object. Formats accepted are a sub-set of available formats from Excel. The easiest way to generate these is to load up ModelCenter and select “Format Variable” on some variable. The dialog will allow you to graphically choose a format and then will show you the correct format string to use in the lower left corner. You may pass in the empty string to mean “General”. Parameters:
  • format: The format string to use.
Parameters:
  • BSTR format
Return type: void

Function stringToLong

Takes a formatted string and converts it to a long (integer). The string must be in the correct format for style being used. Parameters:
  • str: The formatted string.
Returns: The value of the string. Parameters:
  • BSTR str
Return type: long

Function stringToDouble

Takes a formatted string and converts it to a double (real number). The string must be in the correct format for the style being used. For example, if percentage is being used, “1%” will convert to 0.01. Parameters:
  • str: The formatted string.
Returns: The value of the string. Parameters:
  • BSTR str
Return type: double

Function longToString

Takes a long (integer) and converts it to a formatted string. Parameters:
  • val: The long number to format.
Returns: The formatted string. Parameters:
  • long val
Return type: BSTR

Function doubleToString

Takes a double (real number) and converts it to a formatted string. Parameters:
  • val: The double number to format.
Returns: The formatted string. Parameters:
  • double val
Return type: BSTR

Function getFormat

Returns the current format style being used in this object. Returns:
Return type: BSTR

Function stringToString

Converts an unformatted string into a formatted string. Parameters:
  • str: The unformatted string.
Returns: The formatted string. Parameters:
  • BSTR str
Return type: BSTR

Function longToEditableString

Converts a long to its formatted string representation but with full precision for editing. Parameters:
  • val: The long number to format.
Returns: The formatted string. Parameters:
  • long val
Return type: BSTR

Function doubleToEditableString

Converts a double to its formatted string representation but with full precision for editing. Parameters:
  • val: The double number to format.
Returns: The formatted string. Parameters:
  • double val
Return type: BSTR