LOCALIZE

Localize currency

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
xcall LOCALIZE([symbol_source], [sep_source], [dec_pt_source], [symbol_dest],  
&     [sep_dest], [dec_pt_dest][, case])

Arguments

symbol_source

(optional) The currency symbol used in the format string. (a)

sep_source

(optional) The separator character used in the format string. (a)

dec_pt_source

(optional) The decimal point character used in the format string. (a)

symbol_dest

(optional) The currency symbol placed in the formatted output. (a)

sep_dest

(optional) The separator character used in the formatted output. (a)

dec_pt_dest

(optional) The decimal point character placed in the formatted output. (a)

case

(optional) Controls the effect of the UPCASE and LOCASE statements and also affects the S_MATCH and S_PARSE routines wherever the operation depends on (or is independent of) the case of a character. If case is nonzero, the characters [, \, ], and ^ are treated as the uppercase versions of {, |, }, and ~, respectively. (n)

Discussion

The LOCALIZE subroutine modifies the format in which currency is displayed. It enables you to change the behavior of certain Synergy DBL output formatting to comply with local standards. Omitted arguments default to the current settings so that single characters can be changed without affecting other settings.

LOCALIZE overrides flag 1 of the FLAGS subroutine.

When using internationalization in .NET, it’s important that the runtime’s interpretation of destination formatting match that of the current locale (for example, French), as set in .NET (specified by the CultureInfo class). If these are not in sync, conversions from alpha to .NET types such as float, decimal, and double will cause a runtime failure with exceptions.

Examples

In the following example, field contains the value f123.456,00.

    xcall localize("f", ",", ".", "f", ".", ",", 1)
    field = 12345600, "fff,fff.XX"

In the example below, yarg contains the value f1.234.567,89, and xarg contains the value {|}~.

record
    zarg        ,d10.2,     1234567.89
    yarg        ,a15
    xarg        ,a10,       "[\]^"
proc
    xcall localize("$",",",".","f",".",",",1)
    yarg = zarg, "$$$,$$$,$$X.XX"
    upcase xarg
    xreturn
end

The following example shows how you can use LOCALIZE to ensure the currency format expected by the runtime is in sync with the locale set in .NET if non-English defaults are used.

import System.Globalization
proc
    data ni=CultureInfo.CurrentCulture.NumberFormat
    xcall localize("$", ",", ".", ni.CurrencySymbol, 
  &       ni.CurrencyGroupSeparator, ni.CurrencyDecimalSeparator, 1)