![]() |
wie bekoome ich auch nullen hinter dem Komma hin?
Hi!
Ich habe folgendes Problem: Ich habe eine Float-Zahl , die in einem Label angezeigt wird. Wenn die Zahl z.B. 200,3 ist , wird es auch korrekt angezeigt. Wenn die Zahl 200,0 ist , wird nur 200 angezeigt. Ich möchte die Null hinter dem Komma aber auch haben. Kann mir jemand einen Tip geben?? Vielen Dank im Voraus! mfG Andi |
Re: wie bekoome ich auch nullen hinter dem Komma hin?
hi,
Stichwort: "Format()" MfG |
Re: wie bekoome ich auch nullen hinter dem Komma hin?
schau dir mal FormatFloat an.
gruss |
Re: wie bekoome ich auch nullen hinter dem Komma hin?
Hallo Andi,
Format() kann noch sehr viel mehr, aber so geht es:
Delphi-Quellcode:
Grüße vom marabu
FloatLabel.Caption := Format('%.1n', [1000200.3]); // mit Tausenderpunkten
FloatLabel.Caption := Format('%.1f', [1000200.3]); // ohne Tausenderpunkte |
Re: wie bekoome ich auch nullen hinter dem Komma hin?
Hallo!
Das ging ja superschnell! Genau das war es ! Vielen Dank an Euch!! mfG Andi |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:22 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 by Thomas Breitkreuz