DecimalSeparator in SysUtils and System.SysUtils

后端 未结 2 670
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 17:44

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

相关标签:
2条回答
  • 2020-12-03 18:17

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

    FormatSettings.DecimalSeparator
    
    0 讨论(0)
  • 2020-12-03 18:21
    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;
    
    0 讨论(0)
提交回复
热议问题