Autor Beitrag
winx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249



BeitragVerfasst: Mi 24.05.06 14:09 
Hallo,

wie ist es mir möglich einen Double Wert zu runden und diesen einer Integer Zahl zuzuweisen???

Bsp:

ausblenden C#-Quelltext
1:
2:
double  a := 6.999999;
int b := Runde(a); //Wert muß 7 sein!!!


Danke,
winx

Moderiert von user profile iconChristian S.: C#-Tags hinzugefügt
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 24.05.06 14:25 
Hallo!

Mittels Math.Round runden und dann in einen Integer casten.

Grüße
Christian

//edit: Du arbeitest aber mindestens mit .NET 1.1 und nicht 1.0 würde ich vermuten

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
winx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249



BeitragVerfasst: Mi 24.05.06 15:41 
yupp mach ich, danke :-)