Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Math.Floor problem
Message
 
To
19/07/2008 01:21:41
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01332456
Message ID:
01332462
Views:
6
>>Can anybody help me to make this piece work?
>>The problem is that Math.Floor is type of Double and none of casting that I apply to the variables does not work so far. Getting "Cannot implicitly convert type 'double' to 'int' " error all the time.
>>"
>>
>>C#, VS 2003
>>
>>{
>>    int _CurrentPageIndex = 5;
>>    int _PageButtonCount = 2;
>>    int StartLoop = 0;
>>
>>    StartLoop = (Math.Floor(_CurrentPageIndex / _PageButtonCount) * _PageButtonCount) + 1;
>>}
>>
>Maybe you need to initialize StartLoop as a Double instead of an Int, if that's what Math.Floor is returning?

No, doesn't work, still gives the same error.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform