C# Dezimalstellen mit integer-Operatoren

Also ich habe diesen code:

p.Value = 1;
decimal avg = p.Value * 100 / 10000;
string prntout = p.Key + " : " + avg.ToString();
Console.WriteLine(prntout);

Aber das Programm druckt 0, anstelle von 0,01. p.Wert ist ein int. Wie behebe ich das?

InformationsquelleAutor webyacusa | 2010-05-20
Schreibe einen Kommentar