Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   DecimalSeparator (https://www.delphipraxis.net/205104-decimalseparator.html)

Willie1 31. Jul 2020 17:14

DecimalSeparator
 
Hallo, ich habe schon wieder eine Frage.:(

Ich schreibe jetzt die HML-Datei, mit der GoogleEarth anfliegen soll. Das klappt beinahe.
KML-Datei
Delphi-Quellcode:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Placemark>
    <name>2015.03.12=15-47-54.jpg</name>
    <description>Hier wurde das Bild aufgenommen.</description>
    <Point>
      <coordinates>7,90963889, 50,79475556, 0</coordinates> <--- hier ist das Problem.
    </Point>
  </Placemark>
So sieht es falsch aus.
Delphi schreibt bei LON und LAT ein Komma statt den Punkt(Format()), den Google verlangt, entsprechend dem deutschen Setting-Schema. Wie kann ich nur für diese eine Zeile das FormatSetting-Schema auf US umnstellen.
Willie.

Neutral General 31. Jul 2020 17:18

AW: DecimalSeparator
 
TFormatSettings.Create('en-US') liefert dir die US-FormatSettings. Dass musst du dann an die Funktion übergeben die die Zahl in einen String umwandelt.

Willie1 31. Jul 2020 17:56

AW: DecimalSeparator
 
Danke, so geht es. Format hat also eine überladene Variante. Jetzt habe ich es gelernt. Willie.


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:24 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz