DelphiBasics
ThousandSeparator
Variable
The character used to display the thousands separator SysUtils unit
var ThousandSeparator : char;
Description
The ThousandSeparator variable is used in currency and floating point display functions.
 
ThousandSeparator value is ',' by default, but is dependent on your Windows locale.
Notes
ThousandSeparator = LOCALE_STHOUSAND by default.
Related commands
CurrencyDecimalsDefines decimal digit count in the Format function
CurrencyFormatDefines currency string placement in curr display functions
CurrToStrFConvert a currency value to a string with formatting
DecimalSeparatorThe character used to display the decimal point
FormatRich formatting of numbers and text into a string
NegCurrFormatDefines negative amount formatting in currency displays
 Download this web site as a Windows program.




 
Example code : Changing the thousands separator character
var
  amount : Currency;
begin
  amount := 1234567.89;    // 1,234,567 pounds 89 pence

  // Display with the default thousands separator
  ShowMessage('Amount = '+FloatToStrF(amount, ffCurrency, 10, 2));

  // Display with a new thousands separator
  ThousandSeparator := ' ';
  ShowMessage('Amount = '+FloatToStrF(amount, ffCurrency, 10, 2));
end;
Show full unit code
  Amount = ?1,234,567.89
  Amount = ?1 234 567.89
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page