DelphiBasics
DecimalSeparator
Variable
The character used to display the decimal point SysUtils unit
var DecimalSeparator : char;
Description
The DecimalSeparator variable is used in currency and floating point display functions.
 
DecimalSeparator value is '.' by default, depending on the Windows locale.
Notes
DecimalSeparator = LOCALE_SDECIMAL by default.
Related commands
CurrencyDecimalsDefines decimal digit count in the Format function
CurrencyFormatDefines currency string placement in curr display functions
CurrencyStringThe currency string used in currency display functions
CurrToStrFConvert a currency value to a string with formatting
FloatToStrConvert a floating point value to a string
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 decimal point character
var
  amount : Currency;
begin
  amount := 12.34;    // 12 pounds 34 pence

  // Display with the default decimal point character
  ShowMessage('Amount = '+FloatToStrF(amount, ffCurrency, 10, 2));

  // Display with a new decimal point character
  DecimalSeparator := '|';
  ShowMessage('Amount = '+FloatToStrF(amount, ffCurrency, 10, 2));
end;
Show full unit code
  Amount = ?12.34
  Amount = ?12|34
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page