Autor Beitrag
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 03.10.06 14:13 
Moin, Ich habe folgdes vor:
Ich habe zwei Integer-Variablen. Diese habe ich geteilt:
ausblenden Delphi-Quelltext
1:
ergebniss:=V1/V2;					

Nun will ich das mir Delphi eine Prozentzahl ausgibt. Habt ihr eine Idee wie man sowas machen könnte?
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Di 03.10.06 14:14 
Ja, ich habe eine Idee, programmieren und Grundlagen lesen! :wink:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 03.10.06 14:15 
z.B:
V1=1
V2=2

=> 50%
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 03.10.06 14:15 
user profile iconBarzi hat folgendes geschrieben:

Ich habe zwei Integer-Variablen. Diese habe ich geteilt:

Nein, du hast V1 durch V2 geteilt. ;)
user profile iconBarzi hat folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
ergebniss:=V1/V2;					

Nun will ich das mir Delphi eine Prozentzahl ausgibt. Habt ihr eine Idee wie man sowas machen könnte?

Also du willst wissen, wieviel Prozent V2 von V1 ist? Wenn z.B. V1=1 ist und V2=2, dann soll das Ergebnis 200 Prozent sein, oder wie?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 03.10.06 14:16 
Dnake die Idee hatte ich auch schon. Mein Compiler meldet bloß immer einen Fehler :D
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Di 03.10.06 14:16 
:!: Format + F1 :!:
PS: ein bisschen prozentrechnung wäre auch nicht schlecht de.wikipedia.org/wiki/Prozent

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!


Zuletzt bearbeitet von Kroko am Di 03.10.06 14:18, insgesamt 1-mal bearbeitet
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 03.10.06 14:17 
ja genau
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 03.10.06 14:18 
Wie berechnest du denn mit Stift und Papier den Prozentsatz aus Grundwert und Prozentwert?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 03.10.06 14:20 
1:2= 0.5

0.5 sind 50/100stel also 50 %
Reinhard Kern
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 591
Erhaltene Danke: 14



BeitragVerfasst: Di 03.10.06 14:21 
user profile iconBarzi hat folgendes geschrieben:
Moin, Ich habe folgdes vor:
Ich habe zwei Integer-Variablen. Diese habe ich geteilt:
ausblenden Delphi-Quelltext
1:
ergebniss:=V1/V2;					

Nun will ich das mir Delphi eine Prozentzahl ausgibt. Habt ihr eine Idee wie man sowas machen könnte?


Hallo, bekanntlich heisst Prozent auf Deutsch "vom Hundert", daher
ausblenden Delphi-Quelltext
1:
ergebnis:=V1 * 100 / V2;					


das ergibt bei enem Verhältnis von 1.5 eben 150%. Falls du formulieren willst "% grösser" must du noch 100 abziehen,

ausblenden Delphi-Quelltext
1:
ergebnis:=V1 * 100 / V2 - 100;					


ergibt dann "V1 ist 50% grösser als V2".

Das ist keine Delphi-Frage, sondern Rechnen Grundschule.

Gruss Reinhard
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 03.10.06 14:24 
Ok, Danke... Ich bin blöd und ihr seit schlau... sry für diese dumme Frage
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Di 03.10.06 14:26 
user profile iconBarzi hat folgendes geschrieben:
Ok, Danke... Ich bin blöd und ihr seit schlau... sry für diese dumme Frage


Darum geht es doch gar nicht, aber wer programmieren will, sollte ein gewisses Mass an Grundkenntnissen in Inf, Ma, Phy, etc mitbringen und auch ein bisschen Willen :wink:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!