Variables Delphi

var CurrencyString : string;


Description
The CurrencyString variable is used in currency display functions. It is used to prefix or suffix the currency amount.

For example, the UK default is £, so 1.23 is displayed as £1.23 by default.

Notes
The CurrencyFormat value determines whether the currency string is placed before or after the amount, and whether a space is placed between it and the amount.
CurrencyString = LOCALE_SCURRENCY by default.


Related commands
CurrencyDecimals Defines decimal digit count in the Format function
CurrencyFormat Defines currency string placement in curr display functions
CurrToStrF Convert a currency value to a string with formatting
DecimalSeparator The character used to display the decimal point
Format Rich formatting of numbers and text into a string
NegCurrFormat Defines negative amount formatting in currency displays
ThousandSeparator The character used to display the thousands separator

Example code : Changing the currency character to a word
var
amount : Currency;
begin
amount := 12; // 12 pounds
// Display with the default currency string
ShowMessage('Amount = '+CurrToStrF(amount, ffCurrency, 0));
// Display with the currency shown as a word after the amount
CurrencyString := 'Pounds';
CurrencyFormat := 4; // 4 means after with a space
ShowMessage('Amount = '+CurrToStrF(amount, ffCurrency, 0));
end;

Show full unit code
Amount = £12
Amount = 12 Pounds