Einzelnen Beitrag anzeigen

mmw

Registriert seit: 10. Sep 2019
Ort: OWL
324 Beiträge
 
Delphi 11 Alexandria
 
#6

AW: ThousansSeparator - nur ein Mythos?

  Alt 14. Apr 2022, 18:31
hallo,

so sollte es funktionieren.

Delphi-Quellcode:
const
  Zahl: Extended = 1234567890;

var
  AFormatSettings: TFormatSettings;


begin
 AFormatSettings := TFormatSettings.Create;
  try
    AFormatSettings.ThousandSeparator := ' '; // Oder auch so ' '
    showMessage(Format('%n', [Zahl], AFormatSettings));
  except
     on E: Exception do begin
     ShowMessage(E.ClassName+ ': '+ E.Message);
    end;
  end;
 end;

Gruß
  Mit Zitat antworten Zitat