def using [
= ] intlMoneyFormat
This statement specifies how the using function should interpret certain characters in its pattern string; this affects the format of the string returned by using. The intlMoneyForma is specified by four characters packed into a long integer. The characters represent: the decimal point, the thousands separator, the list separator, and the currency symbol. After you execute def using, subsequent numbers formatted with using are formatted as follows:
- A leading dollar sign in the pattern string is replaced with the currency symbol.
- Commas in the pattern string are replaced with the thousands separator.
- A period in the pattern string is replaced with the decimal point.
The following selects the U.S. numeric format (this is also the default if no def using statement has been executed):
def using = _".,;$"
The following selects the international numeric format as set by the system or selected by the user (this is the recommended numeric format to use):
def using = [[fn GetIntlResource(0)]]
The international numeric format returned by
fn GetIntlResource may include a currency symbol which consists of more than one character. def using will pick up only the first character of the currency symbol.
fn GetIntlResource is deprecated by Apple as of the introduction of MacOS X 10.5. The current recommended method to obtain items such as the currency symbol or decimal separator is to use
fn CFLocaleGetValue with an appropriate key such kCFLocaleDecimalSeparator or kCFLocaleCurrencySymbol.