Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DecimalSeparator in SysUtils and System.SysUtils

I need to find DecimalSeparator var SysUtils Delphi 7, in Delphi XE6 i tried to find in System.SysUtils, but without success. Someone can tell me where to find her in Delphi XE6?

In Delphi 7 it is located in SysUtils.pas unit, in line 618:

var 
   CurrencyString: string; 
   CurrencyFormat: Byte; 
   NegCurrFormat: Byte; 
   ThousandSeparator: Char; 
   DecimalSeparator: Char;

I need this variable to convert a component of Delphi 7 to XE6

like image 953
Linces Marques Avatar asked Aug 03 '14 21:08

Linces Marques


2 Answers

My bad, first I needed to call FormatSettings, and then I can use in DecimalSeparator in Delphi XE6,

FormatSettings.DecimalSeparator
like image 123
Linces Marques Avatar answered Sep 19 '22 12:09

Linces Marques


procedure ConfigureBrazilRegion;
var
  FormatBr: TFormatSettings;
begin
  // Create new setting and configure for the brazillian format
  FormatBr                     := TFormatSettings.Create;
  FormatBr.DecimalSeparator    := ',';
  FormatBr.ThousandSeparator   := '.';
  FormatBr.CurrencyDecimals    := 2;
  FormatBr.DateSeparator       := '/';
  FormatBr.ShortDateFormat     := 'dd/mm/yyyy';
  FormatBr.LongDateFormat      := 'dd/mm/yyyy';
  FormatBr.TimeSeparator       := ':';
  FormatBr.TimeAMString        := 'AM';
  FormatBr.TimePMString        := 'PM';
  FormatBr.ShortTimeFormat     := 'hh:nn';
  FormatBr.LongTimeFormat      := 'hh:nn:ss';
  FormatBr.CurrencyString      := 'R$';

  // Assign the App region settings to the newly created format
  System.SysUtils.FormatSettings := WFormatBr;
end;
like image 41
Rod Lima Avatar answered Sep 20 '22 12:09

Rod Lima