SmartPascal
CurrencyDecimals
Variable
Defines decimal digit count in the Format function SysUtils unit
  var CurrencyDecimals : Byte;
Description
The CurrencyDecimals variable provides a default number of decimal digits for the Format and related functions.
Notes
CurrencyDecimals = LOCALE_ICURRDIGITS by default.
Related commands
CurrencyFormat Defines currency string placement in curr display functions
CurrencyString The currency string used in currency 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 : Change the default decimal digits from 2 to 4
// Full Unit code.
// -----------------------------------------------------------
// You must store this code in a unit called Unit1 with a form
// called Form1 that has an OnCreate event called FormCreate.
 
unit Unit1;
 
interface
 
uses
  SysUtils,   // Unit containing the CurrencyDecimals command
  Forms, Dialogs;
 
type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;
 
var
  
Form1: TForm1;
 
implementation
{$R *.dfm} // Include form definitions
 
procedure TForm1.FormCreate(Sender: TObject);

var
  amount : Double;

begin
  amount := 1234.567;

  // Display the amount using the default decimal digits (2)
  ShowMessage('Amount = '+Format('%m', [amount]));

  // Redisplay the amount with 4 decimal digits
  CurrencyDecimals := 4;
  ShowMessage('Amount = '+Format('%m', [amount]));
end;
 
end.
Hide full unit code
   Amount = ?1,234.57
   Amount = ?1,234.5670