Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > S > SET

CURRENCY

Scroll Prev Top Next More

Operating Condition

 

Syntax: SET CURRENCY $ PREF 2 B

 

SET CURRENCY sets the symbol, location, subunits, and format for currency values. R:BASE stores the setting with the database.

 

Changing the CURRENCY parameters affects all columns in the database that have a CURRENCY data type. You must enter the parameters in the following order: SYMBOL, PREF or SUFF, digits, and format; that is, even if you want to change the digits only, you must also enter the symbol and its position.

 

Symbol (default $)--A symbol is any ASCII character or string of one to four characters. You can include a space in place of one character at the beginning or end of the string, but if you do, enclose the string in quotation marks.

 

PREF and SUFF (default PREF)--Specify the position of the symbol as before (PREF) or after (SUFF) the currency value. In the SET CURRENCY command, enter a space between the symbol and its position, PREF or SUFF.

 

Subunit digits (default 2)--Indicates the number of digits from 0 to 16 to be displayed in a currency subunit. In the case of dollars, the subunit is cents, so the digits setting for dollars is 2. For example, setting digits to 3 will display currency values similar to these:

 

20.000,000DM

20,000.000

2,000.000

 

If you change digits when the database contains data, the new digit setting affects how R:BASE displays and uses the data already entered. For example, if you change the setting from 2 to 4, an existing value such as 1,234.00 becomes 12.3400.

 

Format (default B)--Format specifies how R:BASE displays the thousands and decimal delimiters. A, B, C, D, and E specify how the thousands and decimal delimiter displays for values with CURRENCY, REAL, and DOUBLE data types. Before you change the format, you must change the DELIMIT character.

 

Delimiter Conventions for CURRENCY, REAL, and DOUBLE Values

 

Convention

Thousands Delimiter

Decimal Delimiter

Example

A

.

,

123.456.793,01

B

,

.

123,456,793.01

C

(blank)

,

123 456 793,01

D

N/A

.

123456793.01

E

'

.

123'456'793.01

 

For example, to display currency in two digits with a prefix of € (Euro) with the display format A, at the R> Prompt, enter:

 

SET DELIMIT=!

SET CURRENCY € PREF 2 A

 

This configuration displays 1,500 Euro and 25 cents in the format like this:

 

€ 1.500,25

 

If you set CURRENCY to the delimiter formats A or C without changing DELIMIT to a character other than the comma, the default setting for DELIMIT, R:BASE displays the following message: "Decimal character cannot be the same as DELIMIT."

 

In this case, use SET DELIMIT to change the delimiter to a less commonly used character such as an exclamation point; then set CURRENCY to the delimiter formats A or C.