Announcement

Collapse
No announcement yet.

Zahlenformat in DBGrid-Spalten

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Zahlenformat in DBGrid-Spalten

    Hallo,

    wo stelle ich das Float-Zahlenformat z.B. "#.##" bzw. "0.00" ein wenn ich dieIBX-Komponenten (TIBDatabase,TIBTransaction,TIBDataSet...) verwende.

    In einer älteren C++Builder5 Anwendung wird das Format über ein TQuery Objekt->Feldeditor->Eigenschaft DisplayFormat eingestellt. Einen xQuery Objekt habe ich jetzt nicht mehr. Versucht habe ich es mit z.B.:

    DataModule2->DatenFloatZahl->DisplayFormat="#.##";
    oder über das TIBTable Objekt -> Feldeditor -> DisplayFormat.
    Ohne Erfolg.
    Im Spalteneditor des TDBGrids ist auch nichts zu finden.

    Wo stellt man das Zahlenformat ein?

  • #2
    Code:
    TField *f;
    TFloatField *fFloat;
    
    f= Query->FieldByName("E_PREIS");
    fFloat= (TFloatField *) f;
    fFloat->DisplayFormat= ",0.00 €";
    
    f= Query->FieldByName("MENGE");
    fFloat= (TFloatField *) f;
    fFloat->DisplayFormat= ",#";
    Query ist bei mir übrigens eine Instanz von TIBDataset, ein Relikt aus einer Source-Umstellung.
    Dirk

    Comment

    Working...
    X