Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Absolute value of a value
Message
De
10/11/2011 16:30:05
 
 
À
10/11/2011 16:14:57
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01528610
Message ID:
01528618
Vues:
63
>>Math.Abs(value)
>
>I tried that but that is not the same as the VFP CInt() function. Math.Abs(0.39) would return the same value. There must be something I am missing here. I am looking for the 0 value here. As, everything between 0 to 0.99, I would like to obtain 0. So, would be from all values between 1 to 1.99 would return 1.

You don't want Abs( ), you want the .Net equivalent of the VFP FLOOR( ) function.

Although, for your purposes Int( ) should work. They do differ for negative numbers e.g.

INT( 1.99 ) = 1
FLOOR( 1.99 ) = 1

INT( -1.99 ) = -1
FLOOR( -1.99 ) = -2

FLOOR( -2.01 ) = -3
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