Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Round() Bug
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00459503
Message ID:
00459548
Vues:
31
>>Why the arbitrary length of 20? The article suggests the workaround of changing it to a string and back to numeric, so how about just
ROUND( VAL( TRANSFORM(tnNumber)), tnDecimals)

>
>?transform(tnnumber)
>tnnumber=2.0000000056984984924892482948294829
>?transform(tnnumber)
>tnnumber=2.00000000569
>tnnumber=0.00000000569
>?transform(tnnumber)
>tnnumber=0.02000000569
>?transform(tnnumber)
>?val(transform(tnnumber))
>
>The maximum number of decimals, BTW, is 12, as I just found.
tnnumber=2.0000000056984984924892482948294829
?round(val(str(tnnumber,20,16)),15)
Doesn't work correctly...
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform