Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Diff. between Numeric with precision, Currency and Doubl
Message
De
10/06/2003 10:18:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00798235
Message ID:
00798362
Vues:
32
This message has been marked as a message which has helped to the initial question of the thread.
>Thanks Hilmar, but that should mean that the number displayed is rounded to the decimal places as defined to display? What that would mean is that if I have put in 4 decimals as precision for double then though it shows me 4 precision all the other precisions are stored and maybe rev. up there heads when a combined calc. is later perfomed, which may alter the rounded view.
>
>Good or bad?

I am doing experiments with this right now, defining a field "temp", as double, with 2 decimals.
replace temp with pi()
set decimals to 5
? temp
shows 3.14.

However,
? temp * 100
shows 314.16, indicating that the value was stored with a larger precision. I can get all the digits I want, with an expression like ? temp * 1e6.

However, IIRC, on a TextBox directly conected to the field, the user would only be able to type 2 decimals.

If it causes you trouble to have more significant decimals than displayed, you should save data with the round() function.

In other cases, you might be happy with the ability to have more decimals available.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform