Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Currency data type, BUG or FEATURE?
Message
De
09/03/2006 20:14:05
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Currency data type, BUG or FEATURE?
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:
01102959
Vues:
54
Hi all,

I have built the following simple repro code of something that is driving me crazy:
create Cursor temp (unitPrice Y, quantity B(5), discount B(5))

insert into temp values (35760, 10, 28.221)

? UnitPrice                 * quantity * (1 - (discount/100))    && displays 256685.28
? cast(UnitPrice as double) * quantity * (1 - (discount/100))    && displays 256681.704
There is a difference of almost 4 between the 2 calculations. I have a lot of code that makes calculations, and if I have to CAST every bit of it, it's going to take quite a time. Is there a simple solution to this? Is this a BUG or a FEATURE?

Thanks a lot,
Javier.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform