Currency Prompt Literals
The currency prompt literal is always of type Prompt.
CurrencyPrompt:
CurrencyPromptDeclarator [ArgumentList]
CurrencyPromptDeclarator:
$
Currency prompts correspond to the spoken amount representation of the
specified arguments. The CurrencyPromptDeclarator is the symbol for the
specified currency. For example: $, £, or ¥. There cannot be more than four
arguments in the
ArgumentList
and the supported combination are listed as
follows.
1st Argument |
2nd Argument |
3rd Argument |
4th Argument |
Amount | |||
Amount |
Colloquial Flag | ||
Amount |
Currency | ||
Amount |
Colloquial Flag |
Currency | |
Dollar Amount |
Cent Amount | ||
Dollar Amount |
Cent Amount |
Colloquial Flag | |
Dollar Amount |
Cent Amount |
Currency | |
Dollar Amount |
Cent Amount |
Colloquial Flag |
Currency |
An Amount argument must be of type String or a java.lang.Number type (for example, integral or floating-point). The Colloquial Flag argument must be of type Boolean and specifies whether to use colloquial currencies representation like "Dollars" instead of "US Dollars". The Currency argument must be of type Currency.
This form also assumes the current language of the context unless the prompt is further qualified using the @ operator.
Example Currency Prompt Literals:
$[2] // 2 dollars
$[3.3F] // 3 dollars and 30 cents
$["23.33"]
$["23.33", true]
$["123.33", C[CAD]]
$["123.33", false, C[DEM]]
$[23.33 + 2]
$[amount, true]
$[123.33 + 3, C[CAD]]
$[balance, false, C[DEM]]
$[33, 2]
$[15, 7, true]
$[17, 66, C[CAD]]
$[3455 - 3, 88, false, C[DEM]]