I’m stuck with a little issue here, say you have the following code:
int whole = 0;
double decimal = 88.00
whole = decimal / 1.5; //now the answer is 58.66
So here’s the issue, explicitly casting a double to an int is easy enough. But if I do this now ‘whole’ is going to be set to 59. This – is not so good, I want it to be set to the last whole number (being 58).
How do you do this in C#?
Math.Floor: