currencyFormat

currencyFormat(): String;

The currencyFormat method of the Decimal primitive type returns a string containing the receiver in the currency format defined for the current locale; for example, $123.22 or -123.22$. This can include currency symbols, thousands separators, sign characters, and decimal point characters.

The following examples show the use of the currencyFormat method.

// calculate average cost of transactions
tblPortfolio.column := 2;
tblPortfolio.text := portfolio.averageCost.Decimal.currencyFormat;
testDecimal();
vars
    decimalValue : Decimal [12,4];      // Define the Decimal variable
begin
    decimalValue := 1234.56;            // Defines the variable value
    write decimalValue;                 // Outputs  1234.5600
    write decimalValue.currencyFormat;  // Outputs $1,234.56
    decimalValue := -123456;            // Defines the variable value
    write decimalValue;                 // Outputs  -123456.0000
    write decimalValue.currencyFormat;  // Outputs ($123,456.00)
end;

If you do not define the EnhancedLocaleSupport parameter in the [JadeEnvironment] section of the JADE initialization file on the database node or you set it to false, inconsistent results could be returned to the application server when running in JADE thin client mode and there are locale overrides, as all overrides on the application server are suppressed if enhanced locale support is not enabled. Formatting of locale data is done on the application server, based on the locale of the corresponding presentation client.