Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Real to Byte umwandeln? (https://www.delphipraxis.net/133202-real-byte-umwandeln.html)

MCXSC 27. Apr 2009 20:36


Real to Byte umwandeln?
 
Hallo,

ich habe folgendes Problem, bzw. folgenden Codeteil:

Delphi-Quellcode:
[...]
var
  Wert1: Real;
  Wert2: Byte;
begin
  Wert1 := Round(Wert1 / 100 * 10 - 50 / 3);
  Wert2 := Wert1;
end;
Wie man sieht: Ich rechne mit Wert1 eine bestimmte Zahl aus. Diese möchte ich nun in der Variablen Wert2 haben.

Ich finde aber nichts, womit ich den Wert umwandeln kann. :( Jemand einen Tipp?

Danke,
MCXSC

Zacherl 27. Apr 2009 20:39

Re: Real to Byte umwandeln?
 
Delphi-Quellcode:
Wert2 := Round(Wert1)
Und bei der Berechnung von Wert2 das Round einfach weglassen ^^

MCXSC 27. Apr 2009 20:41

Re: Real to Byte umwandeln?
 
-.-

Okay, DAS habe ich natürlich nicht versucht. Danke!!


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:46 Uhr.

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