Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to fix rounding bug
Message
De
24/10/2007 16:05:22
 
 
À
24/10/2007 14:17:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01258001
Message ID:
01263330
Vues:
25
Will it always work?
Why not?

I have created RROUND.PRG like this:
Lparameters m.nNumber , m.nPrecision
Return Iif( m.nNumber < 0 , ;
-1 * Round(Int(Val(Transform(-1* m.nNumber*10^m.nPrecision+.5)))/10^m.nPrecision, m.nPrecision), ;
Round(Int(Val(Transform(m.nNumber*10^m.nPrecision+.5)))/10^m.nPrecision, m.nPrecision) )

All my code uses RROUND instead of ROUND. I have not been able to find any problems with this.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform