Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Math.Floor problem
Message
De
19/07/2008 01:21:41
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
OS:
Windows XP SP2
Divers
Thread ID:
01332456
Message ID:
01332460
Vues:
7
>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?
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform