Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where currency can play an ugly joke
Message
De
15/02/2005 16:15:34
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00986817
Message ID:
00987209
Vues:
32
>SQL Server plays worse jokes on you...
>
>
>declare @c money
>declare @n int
>
>set @c = 9.0000
>set @n = 3
>
>select @c / @n
>select @c * 1 / @n
>select @c * ( 1 / @n )
>
>
>I see that Rick has directed you to the mton() and ntom() functions. Other than that you are simply resurrecting the problem you post every couple of months that is never going to be solved on a binary computer.
>

David, not mixed potatoes with tomatoes, please.

On VFP the issue happen when the multiplication is done,
and VFP do a implicit conversion IEEE float to currency.
On SQL is the division of two integer that return a integer zero,
and none conversion is done.

>>Currency is the only VFP exact decimal number.
>>
>>When you do a multiply or a division you can have some surprises.
>>
>>
>>c=$9
>>n=3
>>
>>? c/n
>>? c*1/n
>>? c*(1/n)
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform