Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Currency VS numeric
Message
 
 
To
05/10/2001 19:36:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00565056
Message ID:
00565060
Views:
22
The currency and numeric values with decimal point both stored internaly in VFP as floating point numbers with the certain precision. The floating point numbers by there nature cannot exactly represent all values. Take a look at Thread #559148 for discussion about this.

>I recently found something new for me when comparing a numeric value against a currency field which are supposed to contain exactly the same amount.
>
>Through the debugger window the numeric variable is shown as:
>Name: tnMonto
>Value: 61323.0200000
>Type: N
>
>The field as:
>Name: monto
>Value: $ 61323.0200
>Type: Y
>
>However when validating “tnMonto = monto” I get a False value.
>
>Any hints about what is going on are greatly appreciated.
>
>Thanks in advance and regards.
>
>Oscar Corte
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform