Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Currency data type, BUG or FEATURE?
Message
De
10/03/2006 13:50:23
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/03/2006 08:28:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01102959
Message ID:
01103212
Vues:
14
This message has been marked as a message which has helped to the initial question of the thread.
>So are ther any advantages in using currency as a data type, instead numeric or double? Apart from output format with the currency sign?

Internally, a currency value is a 64-bit integer which just gets divided by 10000 when used. So any computation with it should be a lot faster than the usual IEEE format floating numbers. It's perfect for financial apps where you may have a long computation.

Other than that - you may need to check your computation for potential errors; when computing anything that includes division by numbers between -1 and 1 you may be better off by using regular IEEE numbers - they may not be as fast, but they maintain a 15 digits mantissa. If you're not sure when and where will VFP internally convert from currency to IEEE and back, you may consider using ntom() and mton() functions to enforce your own order.

BTW, just heard your new president on the radio. She surely sounds good.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform