Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where currency can play an ugly joke
Message
From
15/02/2005 16:15:34
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00986817
Message ID:
00987209
Views:
33
>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)
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform