Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Delphi WebStencilProcessor Funktionsaufruf im Template (https://www.delphipraxis.net/217299-webstencilprocessor-funktionsaufruf-im-template.html)

Starsky911 6. Jun 2025 10:53

WebStencilProcessor Funktionsaufruf im Template
 
Ist es möglich in einem HTML-Template numerische Werte zu formatieren?
Ich würde gerne die Funktion FormatFloat für die Formatierung von Betragswerten nutzen, bekomme eine Fehlermeldung.
Es besteht ja die Möglichkeit Stringwerte zu formatieren mit z.B. Uppercase.
Gibt es eine Übersicht welche Funktionen über RTTI nutzbar sind und welche nicht?

Code:
<tbody>
  @foreach Artikelliste {
    <tr>
      <td>@(UpperCase(loop.bezeichnung))</td>     <-- Funktioniert
      <td>@(FormatFloat('0.00',loop.betrag))</td> <-- Fehler
    </tr>
  }
</tbody>
Vielen Dank im Voraus.
Starsky

gubbe 7. Jun 2025 21:30

AW: WebStencilProcessor Funktionsaufruf im Template
 
Ich würde es mal mit loop.betrag.toString probieren (Parameter siehe Doku).

Starsky911 8. Jun 2025 15:55

AW: WebStencilProcessor Funktionsaufruf im Template
 
Zitat:

Zitat von gubbe (Beitrag 1549287)
Ich würde es mal mit loop.betrag.toString probieren (Parameter siehe Doku).

Das funktioniert leider auch nicht.


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:05 Uhr.

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