Autor Beitrag
kiwicht
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Do 20.03.03 13:14 
... hiho

wie sag ich einem DBEdit-Feld ( oder auch einem Datenbank-Feld ) , das es die enthaltenen Zahlen (Integer) immer mit 2 Nachkommastellen anzeigen soll?
Bruce
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 80



BeitragVerfasst: Do 20.03.03 13:33 
Wenn Du den Feldeditor der zugehörigen Query oder Table öffnest und da
das Feld auswählst, mit dem das DBEdit verbunden ist, solltest Du im OI die Eigenschaft "Displayformat" finden (wenn das Feld numerisch ist). Wenn Du da "#0.00" (ohne die Anführungszeichen) einträgst, müsste das klappen.

Gruß, Bruce
kiwicht Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Do 20.03.03 14:04 
... und wenn das ganze aber dynamisch läuft, ich also zur Entwicklung keine DBFelder hinzufüge?
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Do 20.03.03 14:14 
Dann fügst das eben zur Laufzeit (nach dem Öffnen des DS) hinzu. Displayformat ist eine Eigenschaft von TNumericfield, du musst das Feld also casten.

ausblenden Quelltext
1:
TNumericfield(MyDataset.FieldByName('MyField')).DisplayFormat:='0,00';					


Cu, :)
Udontknow
kiwicht Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Do 20.03.03 14:21 
jooo... THX

jetzt funktioniertst.. musste noch aus dem Komma ein Punkt machen, und fertich.. herrrrlich :D

vielen Dank
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Do 20.03.03 21:55 
hall kiwi cht! :)

verwendest du absichtlich einen dezimalpunkt und ein tausenderkomma?
mir ist es umgekehrt praktischer :wink:

mfg, stefan
kiwicht Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Fr 21.03.03 10:43 
:?

wie meinste das?
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Fr 21.03.03 14:56 
hallo kiwi cht!

wie ich das meine? na so, wie ich es geschrieben hab! ;)

wenn du das displayformat von '0,00' auf '0.00' ändern musstest,
dann ist bei dir kein dezimalkomma, sondern ein dezimalpunkt eingestellt. oder bin ich jetzt total fehl in meiner annahme? :shock:

mfg, stefan
kiwicht Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Fr 21.03.03 18:41 
löl.. achso, jetzt ich verstehen du sagen :D

nein ja, ähm, also wissentlich umgestellt habe ich nichts... vielleicht ist das so Standard bei dbaseIII+ ... wer weiß.
Stört mich aber auch nicht....

warum schreibst du immer kiwi cht?