Autor Beitrag
joerg68
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 116

Win 2000
D5Enterprise
BeitragVerfasst: Mi 29.10.03 16:40 
Bei folgendem Code bekomme ich immer eine Fehlermeldung 8,20 ist kein gültiger Gleitkommawert :?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  // Formatierung
   if MAP.FieldByName('Formatierung').asstring <>'' then
    begin
      Wert := Format(MAP.FieldByName('Formatierung').asstring,[result]);
      result := StrToFloat(Wert);
    end;


Die Variable Wert ist von Typ string und result ist double.

Gruß
Jörg
[/delphi]

_________________
Aus den Chaos sprach eine Stimme " Lächele und sei froh denn es könnte schlimmer kommen". Und ich lächelte und ich war froh.
UND ES KAM SCHLIMMER
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mi 29.10.03 16:50 
das kommt drauf an, was du in der Ländereinstellung eingestellt hast. ist da evtl , als dezimaltrennzeichen eingestellt?

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
joerg68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 116

Win 2000
D5Enterprise
BeitragVerfasst: Mi 29.10.03 16:57 
Als Dezimaltrennzeichen ist in meinem BS das Komma eingestellt.

Gruß
Jörg

_________________
Aus den Chaos sprach eine Stimme " Lächele und sei froh denn es könnte schlimmer kommen". Und ich lächelte und ich war froh.
UND ES KAM SCHLIMMER
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mi 29.10.03 17:00 
hmm, hast du mal geguggt, wie der Wert im Dbugger aussieht? nicht das vielleicht noch nen Leerzeichen dranhängt?

Sonst habe ich auch keine Idee

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
joerg68 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 116

Win 2000
D5Enterprise
BeitragVerfasst: Mi 29.10.03 17:15 
Wert ="8,20"
Da ist jeweils ein Hochkommata zu viel.
Ich habe den Fehler gefunden :oops: :oops:
Ich habe zwar richtig programmiert aber immer meinen FormatString noch mal in Hochkommata angeben. Das war zu viel des guten.
Peinlich Peinlich :oops: :oops:
Ein Anwendungsfehler bei einem programm das ich selbst geschrieben habe.

Trotzdem Danke für die Hilfe

Gruß
Jörg

_________________
Aus den Chaos sprach eine Stimme " Lächele und sei froh denn es könnte schlimmer kommen". Und ich lächelte und ich war froh.
UND ES KAM SCHLIMMER
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mi 29.10.03 18:59 
*gg* exakt den fehler hab auch schon mal gemacht die beiden >''< sehen echt so aus ein doppeltes :? und das übersieht mann dann leicht.

@format: Es gibt übrigens auch die function formatFloat('0.000', f);

_________________
mfg.
mâximôv